| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254 |
- // WARNING - AUTOGENERATED - DO NOT EDIT
- //
- // Generated using `sharpie urho`
- //
- // Cursor.cs
- //
- // Copyright 2015 Xamarin Inc. All rights reserved.
- using System;
- using System.Runtime.InteropServices;
- using System.Collections.Generic;
- using Urho.Urho2D;
- using Urho.Gui;
- using Urho.Resources;
- using Urho.IO;
- using Urho.Navigation;
- using Urho.Network;
- namespace Urho.Gui
- {
- /// <summary>
- /// Mouse cursor %UI element.
- /// </summary>
- public unsafe partial class Cursor : BorderImage
- {
- unsafe partial void OnCursorCreated ();
- [Preserve]
- public Cursor (IntPtr handle) : base (handle)
- {
- OnCursorCreated ();
- }
- [Preserve]
- protected Cursor (UrhoObjectFlag emptyFlag) : base (emptyFlag)
- {
- OnCursorCreated ();
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern int Cursor_GetType (IntPtr handle);
- private StringHash UrhoGetType ()
- {
- Runtime.ValidateRefCounted (this);
- return new StringHash (Cursor_GetType (handle));
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr Cursor_GetTypeName (IntPtr handle);
- private string GetTypeName ()
- {
- Runtime.ValidateRefCounted (this);
- return Marshal.PtrToStringAnsi (Cursor_GetTypeName (handle));
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern int Cursor_GetTypeStatic ();
- private static StringHash GetTypeStatic ()
- {
- Runtime.Validate (typeof(Cursor));
- return new StringHash (Cursor_GetTypeStatic ());
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr Cursor_GetTypeNameStatic ();
- private static string GetTypeNameStatic ()
- {
- Runtime.Validate (typeof(Cursor));
- return Marshal.PtrToStringAnsi (Cursor_GetTypeNameStatic ());
- }
- [Preserve]
- public Cursor () : this (Application.CurrentContext)
- {
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr Cursor_Cursor (IntPtr context);
- [Preserve]
- public Cursor (Context context) : base (UrhoObjectFlag.Empty)
- {
- Runtime.Validate (typeof(Cursor));
- handle = Cursor_Cursor ((object)context == null ? IntPtr.Zero : context.Handle);
- Runtime.RegisterObject (this);
- OnCursorCreated ();
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Cursor_RegisterObject (IntPtr context);
- /// <summary>
- /// Register object factory.
- /// </summary>
- public new static void RegisterObject (Context context)
- {
- Runtime.Validate (typeof(Cursor));
- Cursor_RegisterObject ((object)context == null ? IntPtr.Zero : context.Handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Cursor_DefineShape (IntPtr handle, string shape, IntPtr image, ref Urho.IntRect imageRect, ref Urho.IntVector2 hotSpot);
- /// <summary>
- /// Define a shape.
- /// </summary>
- public void DefineShape (string shape, Image image, Urho.IntRect imageRect, Urho.IntVector2 hotSpot)
- {
- Runtime.ValidateRefCounted (this);
- Cursor_DefineShape (handle, shape, (object)image == null ? IntPtr.Zero : image.Handle, ref imageRect, ref hotSpot);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Cursor_DefineShape0 (IntPtr handle, CursorShape shape, IntPtr image, ref Urho.IntRect imageRect, ref Urho.IntVector2 hotSpot);
- /// <summary>
- /// Define a shape.
- /// </summary>
- public void DefineShape (CursorShape shape, Image image, Urho.IntRect imageRect, Urho.IntVector2 hotSpot)
- {
- Runtime.ValidateRefCounted (this);
- Cursor_DefineShape0 (handle, shape, (object)image == null ? IntPtr.Zero : image.Handle, ref imageRect, ref hotSpot);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Cursor_SetShape (IntPtr handle, string shape);
- /// <summary>
- /// Set current shape.
- /// </summary>
- private void SetShape (string shape)
- {
- Runtime.ValidateRefCounted (this);
- Cursor_SetShape (handle, shape);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Cursor_SetShape1 (IntPtr handle, CursorShape shape);
- /// <summary>
- /// Set current shape.
- /// </summary>
- public void SetShape (CursorShape shape)
- {
- Runtime.ValidateRefCounted (this);
- Cursor_SetShape1 (handle, shape);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Cursor_SetUseSystemShapes (IntPtr handle, bool enable);
- /// <summary>
- /// Set whether to use system default shapes. Is only possible when the OS mouse cursor has been set visible from the Input subsystem.
- /// </summary>
- private void SetUseSystemShapes (bool enable)
- {
- Runtime.ValidateRefCounted (this);
- Cursor_SetUseSystemShapes (handle, enable);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr Cursor_GetShape (IntPtr handle);
- /// <summary>
- /// Get current shape.
- /// </summary>
- private string GetShape ()
- {
- Runtime.ValidateRefCounted (this);
- return Marshal.PtrToStringAnsi (Cursor_GetShape (handle));
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Cursor_GetUseSystemShapes (IntPtr handle);
- /// <summary>
- /// Return whether is using system default shapes.
- /// </summary>
- private bool GetUseSystemShapes ()
- {
- Runtime.ValidateRefCounted (this);
- return Cursor_GetUseSystemShapes (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Cursor_ApplyOSCursorShape (IntPtr handle);
- /// <summary>
- /// Apply pending OS cursor shape. Called by UI. No-op when the OS mouse pointer is not used.
- /// </summary>
- public void ApplyOSCursorShape ()
- {
- Runtime.ValidateRefCounted (this);
- Cursor_ApplyOSCursorShape (handle);
- }
- public override StringHash Type {
- get {
- return UrhoGetType ();
- }
- }
- public override string TypeName {
- get {
- return GetTypeName ();
- }
- }
- [Preserve]
- public new static StringHash TypeStatic {
- get {
- return GetTypeStatic ();
- }
- }
- public new static string TypeNameStatic {
- get {
- return GetTypeNameStatic ();
- }
- }
- /// <summary>
- /// Get current shape.
- /// Or
- /// Set current shape.
- /// </summary>
- public string Shape {
- get {
- return GetShape ();
- }
- set {
- SetShape (value);
- }
- }
- /// <summary>
- /// Return whether is using system default shapes.
- /// Or
- /// Set whether to use system default shapes. Is only possible when the OS mouse cursor has been set visible from the Input subsystem.
- /// </summary>
- public bool UseSystemShapes {
- get {
- return GetUseSystemShapes ();
- }
- set {
- SetUseSystemShapes (value);
- }
- }
- }
- }
|