public const string Aul = "libaul.so.0";
public const string Application = "libcapi-appfw-application.so.0";
public const string Glib = "libglib-2.0.so.0";
+ public const string Elementary = "libelementary.so.1";
+ public const string Evas = "libevas.so.1";
}
}
--- /dev/null
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop {
+ internal static partial class Window {
+ [DllImport(Libraries.Elementary, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern IntPtr elm_win_add(IntPtr parent, string name, int type);
+
+ [DllImport(Libraries.Evas, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern void evas_object_show(IntPtr obj);
+
+ [DllImport(Libraries.Evas, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern void evas_object_hide(IntPtr obj);
+
+ [DllImport(Libraries.Evas, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern bool evas_object_visible_get(IntPtr obj);
+
+ [DllImport(Libraries.Evas, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern void evas_object_unref(IntPtr obj);
+
+ [DllImport(Libraries.Evas, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern void elm_win_activate(IntPtr obj);
+
+ [DllImport(Libraries.Evas, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern void elm_win_lower(IntPtr obj);
+ }
+}
<Compile Include="Interop\Interop.Aul.cs" />
<Compile Include="Interop\Interop.Glib.cs" />
<Compile Include="Interop\Interop.Libraries.cs" />
+ <Compile Include="Interop\Interop.Window.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Tizen.Application\Actor.cs" />
<Compile Include="Tizen.Application\AppControl.cs" />
<Compile Include="Tizen.Application\ApplicationContext.cs" />
<Compile Include="Tizen.Application\CodeExample.cs" />
<Compile Include="Tizen.Application\Page.cs" />
+ <Compile Include="Tizen.Application\Window.cs" />
<Compile Include="Tizen.Application\TizenSynchronizationContext.cs" />
</ItemGroup>
<ItemGroup>
<Target Name="AfterBuild">
</Target>
-->
-</Project>
\ No newline at end of file
+</Project>
private static Dictionary<string, Type> _actorMap = new Dictionary<string, Type>();
private static Dictionary<AppControlFilter, Type> _filterMap = new Dictionary<AppControlFilter, Type>();
private static List<ApplicationContext> _contextList = new List<ApplicationContext>();
+ private static Window _window = null;
public static event EventHandler ApplicationInit;
public static event EventHandler ApplicationExit;
{
_contextList.Add(new ApplicationContext());
ApplicationInit(null, null);
+ if (_window == null)
+ _window = new Window();
return true;
};
ops.OnPause = (userData) =>
ApplicationContext ctx = new ApplicationContext();
_contextList.Add(ctx);
Actor actor = ctx.StartActor(item.Value, appControl);
+
// TODO: Resume should be called by windows event
- actor.Resume();
+ if (!_window.Visible) {
+ _window.Active();
+ _window.Show();
+ actor.Resume();
+ }
}
break;
}
--- /dev/null
+using System;
+
+namespace Tizen.Application {
+ class Window : IDisposable {
+ private IntPtr _native_window = IntPtr.Zero;
+
+ public bool Visible {
+ get {
+ return _native_window != IntPtr.Zero ? Interop.Window.evas_object_visible_get(_native_window) : false;
+ }
+ }
+ public Window() {
+ _native_window = Interop.Window.elm_win_add(IntPtr.Zero, "Window", 0);
+ }
+ ~Window() {
+ Dispose();
+ }
+ public void Show() {
+ Interop.Window.evas_object_show(_native_window);
+ }
+ public void Hide() {
+ Interop.Window.evas_object_hide(_native_window);
+ }
+ public void Active() {
+ Interop.Window.elm_win_activate(_native_window);
+ }
+ public void InActive() {
+ Interop.Window.elm_win_lower(_native_window);
+ }
+
+ public void Dispose() {
+ if (_native_window != IntPtr.Zero) {
+ Interop.Window.evas_object_unref(_native_window);
+ _native_window = IntPtr.Zero;
+ }
+ }
+ }
+}