--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace OpenTK.Platform.Tizen
+{
+ /// <summary>
+ /// Describes Tizen window attributes.
+ /// </summary>
+ public interface ITizenWindowAttributes
+ {
+ /// <summary>
+ /// Get or set whether the window accepts a focus or not.
+ /// </summary>
+ bool IsFocusAllowed { get; set; }
+
+ /// <summary>
+ /// Get or set opacity of the window
+ /// </summary>
+ float WindowOpacity { get; set; }
+
+ /// <summary>
+ /// Add a supported auxiliary hint to the window
+ /// </summary>
+ /// <param name="hint">The auxiliary hint string</param>
+ /// <param name="value">The value string to be set</param>
+ /// <returns></returns>
+ uint AddAuxiliaryHint(string hint, string value);
+ }
+}
[SuppressUnmanagedCodeSecurity]
[DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetHint", ExactSpelling = true)]
public static extern IntPtr SetHint(string name, string value);
+
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Tizen_GetSupportedAuxiliaryHintCount", ExactSpelling = true)]
+ public static extern uint SDL_Tizen_GetSupportedAuxiliaryHintCount(IntPtr window);
+
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Tizen_GetSupportedAuxiliaryHint", ExactSpelling = true)]
+ public static extern string SDL_Tizen_GetSupportedAuxiliaryHint(IntPtr window, uint index);
+
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Tizen_AddAuxiliaryHint", ExactSpelling = true)]
+ public static extern uint SDL_Tizen_AddAuxiliaryHint(IntPtr window, string hint, string value);
+
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Tizen_RemoveAuxiliaryHint", ExactSpelling = true)]
+ public static extern bool SDL_Tizen_RemoveAuxiliaryHint(IntPtr window, uint id);
+
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Tizen_SetAuxiliaryHint", ExactSpelling = true)]
+ public static extern bool SDL_Tizen_SetAuxiliaryHint(IntPtr window, uint id, string value);
+
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Tizen_GetAuxiliaryHintValue", ExactSpelling = true)]
+ public static extern string SDL_Tizen_GetAuxiliaryHintValue(IntPtr window, uint id);
+
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Tizen_SetWindowAcceptFocus", ExactSpelling = true)]
+ public static extern bool SDL_Tizen_SetWindowAcceptFocus(IntPtr window, bool accept);
+
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Tizen_GetWindowAcceptFocus", ExactSpelling = true)]
+ public static extern bool SDL_Tizen_GetWindowAcceptFocus(IntPtr window);
+
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowOpacity", ExactSpelling = true)]
+ public static extern int SDL_SetWindowOpacity(IntPtr window, float opacity);
+
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWindowOpacity", ExactSpelling = true)]
+ public static extern int SDL_GetWindowOpacity(IntPtr window, out float opacity);
}
}
namespace OpenTK.Platform.Tizen
{
- internal class TizenGameWindow : GameWindow
+ internal class TizenGameWindow : GameWindow, ITizenWindowAttributes
{
public TizenGameWindow()
: this(GraphicsMode.Default, DisplayDevice.Default, 2, 0)
public bool Paused { get; set; }
+ public bool IsFocusAllowed
+ {
+ get
+ {
+ return SDL2.SDL.SDL_Tizen_GetWindowAcceptFocus(WindowInfo.Handle);
+ }
+
+ set
+ {
+ SDL2.SDL.SDL_Tizen_SetWindowAcceptFocus(WindowInfo.Handle, value);
+ }
+ }
+
+ public float WindowOpacity
+ {
+ get
+ {
+ float opacity = 0.0f;
+ SDL2.SDL.SDL_GetWindowOpacity(WindowInfo.Handle, out opacity);
+ return opacity;
+ }
+
+ set
+ {
+ SDL2.SDL.SDL_SetWindowOpacity(WindowInfo.Handle, value);
+ }
+ }
+
protected override void OnUpdateFrame(FrameEventArgs e)
{
if (!Paused)
{
base.Run(updates_per_second, frames_per_second);
}
+
+ public uint AddAuxiliaryHint(string hint, string value)
+ {
+ return SDL2.SDL.SDL_Tizen_AddAuxiliaryHint(WindowInfo.Handle, hint, value);
+ }
}
}