From 084297ece33f5ce1b025b4a12d2235e9bd70d46b Mon Sep 17 00:00:00 2001 From: Pawel Andruszkiewicz Date: Wed, 12 Apr 2017 09:16:14 +0200 Subject: [PATCH] Add API to show/hide the indicator Change-Id: I4b7999395166d2bc45b472c7e4c35fe6da03690a Signed-off-by: Pawel Andruszkiewicz --- packaging/elm-sharp.spec | 2 +- src/ElmSharp/ElmSharp/Window.cs | 37 +++++++++++++++++++++++++- src/ElmSharp/Interop/Interop.Elementary.Win.cs | 4 +-- 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/packaging/elm-sharp.spec b/packaging/elm-sharp.spec index 5a8658a..17f1e13 100644 --- a/packaging/elm-sharp.spec +++ b/packaging/elm-sharp.spec @@ -1,4 +1,4 @@ -%define DEV_VERSION beta-019 +%define DEV_VERSION beta-020 Name: elm-sharp Summary: C# Binding for Elementary diff --git a/src/ElmSharp/ElmSharp/Window.cs b/src/ElmSharp/ElmSharp/Window.cs index 52391de..5025e4b 100755 --- a/src/ElmSharp/ElmSharp/Window.cs +++ b/src/ElmSharp/ElmSharp/Window.cs @@ -78,6 +78,25 @@ namespace ElmSharp } /// + /// Indicator mode. + /// + public enum IndicatorMode + { + /// + /// Unknown indicator state. + /// + Unknown = 0, + /// + /// Hides the indicator. + /// + Hide, + /// + /// Shows the indicator. + /// + Show, + }; + + /// /// The Window is container that contain the graphical user interface of a program. /// public class Window : Widget @@ -112,7 +131,7 @@ namespace ElmSharp { Name = name; Realize(parent); - Interop.Elementary.elm_win_indicator_mode_set(Handle, 2 /* ELM_WIN_INDICATOR_SHOW */); + IndicatorMode = IndicatorMode.Show; _deleteRequest = new SmartEvent(this, "delete,request"); _rotationChanged = new SmartEvent(this, "wm,rotation,changed"); @@ -297,6 +316,22 @@ namespace ElmSharp } /// + /// Gets or sets the window's indicator mode. + /// + /// The indicator mode. + public IndicatorMode IndicatorMode + { + get + { + return Interop.Elementary.elm_win_indicator_mode_get(RealHandle); + } + set + { + Interop.Elementary.elm_win_indicator_mode_set(RealHandle, value); + } + } + + /// /// This function sends a request to the Windows Manager to activate the Window. /// If honored by the WM, the window receives the keyboard focus. /// diff --git a/src/ElmSharp/Interop/Interop.Elementary.Win.cs b/src/ElmSharp/Interop/Interop.Elementary.Win.cs index 30871f0..6a8ac80 100644 --- a/src/ElmSharp/Interop/Interop.Elementary.Win.cs +++ b/src/ElmSharp/Interop/Interop.Elementary.Win.cs @@ -83,10 +83,10 @@ internal static partial class Interop internal static extern int elm_win_indicator_opacity_get(IntPtr obj); [DllImport(Libraries.Elementary)] - internal static extern void elm_win_indicator_mode_set(IntPtr obj, int mode); + internal static extern void elm_win_indicator_mode_set(IntPtr obj, IndicatorMode mode); [DllImport(Libraries.Elementary)] - internal static extern int elm_win_indicator_mode_get(IntPtr obj); + internal static extern IndicatorMode elm_win_indicator_mode_get(IntPtr obj); [DllImport(Libraries.Elementary)] internal static extern void elm_win_conformant_set(IntPtr obj, bool conformant); -- 2.7.4