From 7f907ecd9d6152753619967b3b7e2033f69abb28 Mon Sep 17 00:00:00 2001 From: Xavi Artigas Date: Tue, 14 May 2019 08:51:05 +0200 Subject: [PATCH] efl-mono: Use Efl.Ui.Win API instead of Elm.Policy Summary: This removes another bit of legacy API from the C# bindings. This also reverts "elm: Put back Policy and Policy_Quit in EO files" (a9132a9a66955608e913bb1228e4adb371310b09) so that these two Elm enums are definitely out of the EO files. Test Plan: Everything, including mono bindings, continue to build. At runtime, C# apps still exit when all windows are closed. Reviewers: lauromoura, vitor.sousa, q66 Reviewed By: q66 Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8890 --- src/bindings/mono/efl_mono/efl_all.cs | 3 +- .../mono/efl_mono/efl_csharp_application.cs | 2 +- src/lib/elementary/elm_general.eot | 27 -------------- src/lib/elementary/elm_general.h | 35 +++++++++++++++++++ 4 files changed, 37 insertions(+), 30 deletions(-) diff --git a/src/bindings/mono/efl_mono/efl_all.cs b/src/bindings/mono/efl_mono/efl_all.cs index 873bd67e48..48a79b5a3a 100644 --- a/src/bindings/mono/efl_mono/efl_all.cs +++ b/src/bindings/mono/efl_mono/efl_all.cs @@ -23,7 +23,6 @@ static class UnsafeNativeMethods private static Efl.Eo.FunctionWrapper _evas_init; [DllImport(efl.Libs.Evas)] public static extern void evas_shutdown(); [DllImport(efl.Libs.Elementary)] public static extern int elm_init(int argc, IntPtr argv); - [DllImport(efl.Libs.Elementary)] public static extern void elm_policy_set(int policy, int policy_detail); [DllImport(efl.Libs.Elementary)] public static extern void elm_shutdown(); [DllImport(efl.Libs.Elementary)] public static extern void elm_run(); [DllImport(efl.Libs.Elementary)] public static extern void elm_exit(); @@ -117,7 +116,7 @@ public static class Config #endif elm_init(0, IntPtr.Zero); - elm_policy_set((int)Elm.Policy.Quit, (int)Elm.PolicyQuit.LastWindowHidden); + Efl.Ui.Win.ExitOnAllWindowsClosed = new Eina.Value(0); } public static void Shutdown() diff --git a/src/bindings/mono/efl_mono/efl_csharp_application.cs b/src/bindings/mono/efl_mono/efl_csharp_application.cs index 1e63d62c4a..ea29376c6c 100644 --- a/src/bindings/mono/efl_mono/efl_csharp_application.cs +++ b/src/bindings/mono/efl_mono/efl_csharp_application.cs @@ -61,7 +61,7 @@ public abstract class Application #endif elm_init(0, IntPtr.Zero); - elm_policy_set((int)Elm.Policy.Quit, (int)Elm.PolicyQuit.LastWindowHidden); + Efl.Ui.Win.ExitOnAllWindowsClosed = new Eina.Value(0); } initComponent = component; diff --git a/src/lib/elementary/elm_general.eot b/src/lib/elementary/elm_general.eot index f76866459f..12d800b11a 100644 --- a/src/lib/elementary/elm_general.eot +++ b/src/lib/elementary/elm_general.eot @@ -2,33 +2,6 @@ * NOTE: Some of those types still need to be moved to Efl.Ui */ -enum Elm.Policy -{ - [[Policy identifiers.]] - quit, [[under which circumstances the application should quit automatically. - See also @Elm.Policy.quit.]] - exit, [[defines elm_exit() behaviour. See also @Elm.Policy.exit. - - @since 1.8 - ]] - throttle, [[defines how throttling should work. See also @Elm.Policy.throttle - - @since 1.8 - ]] - last [[Sentinel value to indicate last enum field during iteration]] -} - -/* FIXME: elm_policy API is not bound to EO */ -enum Elm.Policy_Quit -{ - [[Possible values for the @Elm.Policy.quit policy]] - none = 0, [[never quit the application automatically]] - last_window_closed, [[quit when the application's last window is closed]] - last_window_hidden [[quit when the application's last window is hidden - - @since 1.14]] -} - /* Legacy-only function pointer types, for the legacy EO classes (genlist, etc...) */ type Evas_Smart_Cb: __undefined_type; [[Evas smart callback type]] diff --git a/src/lib/elementary/elm_general.h b/src/lib/elementary/elm_general.h index cc4fba4c19..4ee178b4df 100644 --- a/src/lib/elementary/elm_general.h +++ b/src/lib/elementary/elm_general.h @@ -32,6 +32,41 @@ typedef struct _Elm_Event_Policy_Changed int old_value; /**< new value the policy got */ } Elm_Event_Policy_Changed; +/** Policy identifiers. + * + * @ingroup Elm + */ +typedef enum +{ + ELM_POLICY_QUIT = 0, /**< under which circumstances the application should + * quit automatically. See also @ref ELM_POLICY_QUIT. */ + ELM_POLICY_EXIT, /**< defines elm_exit() behaviour. See also + * @ref ELM_POLICY_EXIT. + * + * @since 1.8 */ + ELM_POLICY_THROTTLE, /**< defines how throttling should work. See also + * @ref ELM_POLICY_THROTTLE + * + * @since 1.8 */ + ELM_POLICY_LAST /**< Sentinel value to indicate last enum field during + * iteration */ +} Elm_Policy; + +/** Possible values for the @ref ELM_POLICY_QUIT policy + * + * @ingroup Elm + */ +typedef enum +{ + ELM_POLICY_QUIT_NONE = 0, /**< never quit the application automatically */ + ELM_POLICY_QUIT_LAST_WINDOW_CLOSED, /**< quit when the application's last + * window is closed */ + ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN /**< quit when the application's last + * window is hidden + * + * @since 1.14 */ +} Elm_Policy_Quit; + /** Possible values for the @ref ELM_POLICY_EXIT policy. * * @since 1.8