<Compile Include="TC\SliderTest1.cs" />
<Compile Include="TC\SpinnerTest1.cs" />
<Compile Include="TC\ToolbarTest1.cs" />
+ <Compile Include="TC\WindowInternalTest.cs" />
<Compile Include="TestCaseBase.cs" />
<Compile Include="TestRunner.cs" />
</ItemGroup>
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{2F98DAC9-6F16-457B-AED7-D43CAC379341}" Configuration="Debug|Any CPU">
- <ProjectCorporateFlavorCfg />
+ <ProjectCommonFlavorCfg />
</FlavorProperties>
<FlavorProperties GUID="{2F98DAC9-6F16-457B-AED7-D43CAC379341}" Configuration="Release|Any CPU">
- <ProjectCorporateFlavorCfg />
+ <ProjectCommonFlavorCfg />
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
-</Project>
+</Project>
\ No newline at end of file
--- /dev/null
+using Tizen.Applications;
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+using System;
+using ElmSharp;
+using System.Diagnostics;
+
+namespace ElmSharp.Test
+{
+ class WindowInternalTest : TestCaseBase
+ {
+ public override string TestName => "WindowInternalTest";
+ public override string TestDescription => "Window Test";
+
+ public override void Run(Window window)
+ {
+ var firstWindow = (Application.Current as TestRunner)?._firstPageWindow;
+ firstWindow.Hide();
+ firstWindow.Unrealize();
+
+ Button button1 = new Button(window) {
+ Text = "Iconified",
+ };
+ button1.Resize(window.ScreenSize.Width, 100);
+ button1.Move(0, 0);
+ button1.Show();
+
+ button1.Clicked += (e, o) =>
+ {
+ window.Iconified = true;
+ };
+
+ Button button2 = new Button(window)
+ {
+ Text = "WinKeyGrab",
+ };
+ button2.Resize(window.ScreenSize.Width, 100);
+ button2.Move(0, 100);
+ button2.Show();
+
+ button2.Clicked += (e, o) =>
+ {
+ Debug.WriteLine("@@KeyGrab");
+ window.KeyGrab(EvasKeyEventArgs.PlatformHomeButtonName, true);
+ window.WinKeyGrab(EvasKeyEventArgs.PlatformHomeButtonName, KeyGrabMode.Exclusive);
+ };
+
+ Button button3 = new Button(window)
+ {
+ Text = "WinUnKeyGrab",
+ };
+ button3.Resize(window.ScreenSize.Width, 100);
+ button3.Move(0, 200);
+ button3.Show();
+
+ button3.Clicked += (e, o) =>
+ {
+ Debug.WriteLine("@@UnKeyGrab");
+ window.WinKeyUngrab(EvasKeyEventArgs.PlatformHomeButtonName);
+ window.KeyUngrab(EvasKeyEventArgs.PlatformHomeButtonName);
+
+ };
+ window.KeyGrab(EvasKeyEventArgs.PlatformBackButtonName, true);
+ EventHandler<EvasKeyEventArgs> handler = (s, e) =>
+ {
+ Debug.WriteLine("@@KeyDown start" + e.KeyName);
+
+ if (e.KeyName == EvasKeyEventArgs.PlatformBackButtonName)
+ {
+ Application.Current.Exit();
+ }
+ if (e.KeyName == EvasKeyEventArgs.PlatformHomeButtonName)
+ {
+ Debug.WriteLine("@@KeyDown OK : " + window.Iconified);
+ window.Iconified = !window.Iconified;
+ }
+ };
+
+ window.KeyUp += handler;
+ }
+
+ }
+}
{
public class TestRunner : CoreUIApplication
{
- private Window _firstPageWindow;
+ internal Window _firstPageWindow;
private static bool s_terminated;
public static string ResourceDir { get; private set; }
using System;
using System.Collections.Generic;
+using System.ComponentModel;
namespace ElmSharp
{
Transparent = 3,
}
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public enum KeyGrabMode
+ {
+ Shared = 256,
+ Topmost = 512,
+ Exclusive = 1024,
+ OverrideExclusive = 2048,
+ }
+
/// <summary>
/// The Window is container that contain the graphical user interface of a program.
/// </summary>
}
}
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool Iconified
+ {
+ get
+ {
+ return Interop.Elementary.elm_win_iconified_get(RealHandle);
+ }
+ set
+ {
+ Interop.Elementary.elm_win_iconified_set(RealHandle, value);
+ }
+ }
+
/// <summary>
/// This function sends a request to the Windows Manager to activate the Window.
/// If honored by the WM, the window receives the keyboard focus.
Interop.Elementary.elm_win_resize_object_add(Handle, obj);
}
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void WinKeyGrab(string keyname, KeyGrabMode mode)
+ {
+ Interop.Elementary.elm_win_keygrab_set(RealHandle, keyname, 0, 0, 0, mode);
+ }
+
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void WinKeyUngrab(string keyname)
+ {
+ Interop.Elementary.elm_win_keygrab_unset(RealHandle, keyname, 0, 0);
+ }
/// <summary>
/// Set the keygrab of the window.
* limitations under the License.
*/
+using ElmSharp;
using System;
using System.Runtime.InteropServices;
[DllImport(Libraries.Elementary)]
internal static extern void elm_win_screen_dpi_get(IntPtr obj, out int xdpi, out int ydpi);
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_win_iconified_set(IntPtr obj, bool iconified);
+
+ [DllImport(Libraries.Elementary)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool elm_win_iconified_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool elm_win_keygrab_set(IntPtr obj, string key, ulong modifiers, ulong notModifiers, int proirity, KeyGrabMode grabMode);
+
+ [DllImport(Libraries.Elementary)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool elm_win_keygrab_unset(IntPtr obj, string key, ulong modifiers, ulong notModifiers);
+
[DllImport(Libraries.Eext)]
internal static extern bool eext_win_keygrab_set(IntPtr obj, string key);
-%define DEV_VERSION beta-018
+%define DEV_VERSION beta-019
Name: elm-sharp
Summary: C# Binding for Elementary