namespace LibTVRefCommonTizen.Ports
{
+ /// <summary>
+ /// Handles Window APIs
+ /// </summary>
public class WindowPort : IWindowAPIs
{
internal class ElmWindow
{
[DllImport("libelementary.so.1", EntryPoint = "elm_win_keygrab_set", CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr elm_win_keygrab_set(IntPtr obj, string key, ulong modifiers, ulong not_modifiers, int proirity, int grab_mode);
+ internal static extern IntPtr ElmWinKeygrabSet(IntPtr obj, string key, ulong modifiers, ulong not_modifiers, int proirity, int grab_mode);
[DllImport("libelementary.so.1", EntryPoint = "elm_win_iconified_set", CallingConvention = CallingConvention.Cdecl)]
- internal static extern void elm_win_iconified_set(IntPtr obj, bool iconified);
+ internal static extern void ElmWinIconfiedSet(IntPtr obj, bool iconified);
[DllImport("libelementary.so.1", EntryPoint = "elm_win_iconified_get", CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool elm_win_iconified_get(IntPtr obj);
+ internal static extern bool ElmWinIconifiedGet(IntPtr obj);
}
+ /// <summary>
+ /// The main window of the App
+ /// </summary>
static private Window mainWindow;
-
public Window MainWindow
{
set
}
}
+ /// <summary>
+ /// Sets the keygrab of the Elm_Win object
+ /// </summary>
+ /// <param name="key">
+ /// keyname string to set keygrab
+ /// </param>
public void SetKeyGrabExclusively(string key)
{
if (mainWindow != null)
- ElmWindow.elm_win_keygrab_set((IntPtr)mainWindow, key, 0, 0, 0, 1024);
+ {
+ ElmWindow.ElmWinKeygrabSet((IntPtr)mainWindow, key, 0, 0, 0, 1024);
+ }
}
+ /// <summary>
+ /// Sets the iconified state of a window
+ /// </summary>
+ /// <param name="iconified">
+ /// If true the window is iconified, otherwise false
+ /// </param>
public void SetIconified(bool iconified)
{
if (mainWindow != null)
- ElmWindow.elm_win_iconified_set((IntPtr)mainWindow, iconified);
+ {
+ ElmWindow.ElmWinIconfiedSet((IntPtr)mainWindow, iconified);
+ }
}
+ /// <summary>
+ /// Gets the iconified state of a window
+ /// </summary>
+ /// <returns>
+ /// true if the window is iconified, otherwise false
+ /// </returns>
public bool GetIconified()
{
- if (mainWindow != null)
- return ElmWindow.elm_win_iconified_get((IntPtr)mainWindow);
- else
- return false;
+ return (mainWindow != null) ? ElmWindow.ElmWinIconifiedGet((IntPtr)mainWindow) : false;
}
+ /// <summary>
+ /// Activates the window object
+ /// </summary>
+ /// <remarks>
+ /// This is just a request that a Window Manager may ignore, so calling this function does not ensure in any way that the window is going to be the active one after it
+ /// </remarks>
public void Active()
{
if (mainWindow != null)
+ {
mainWindow.Active();
+ }
}
}
}