| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377 |
- // WARNING - AUTOGENERATED - DO NOT EDIT
- //
- // Generated using `sharpie urho`
- //
- // Menu.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>
- /// %Menu %UI element that optionally shows a popup.
- /// </summary>
- public unsafe partial class Menu : Button
- {
- unsafe partial void OnMenuCreated ();
- [Preserve]
- public Menu (IntPtr handle) : base (handle)
- {
- OnMenuCreated ();
- }
- [Preserve]
- protected Menu (UrhoObjectFlag emptyFlag) : base (emptyFlag)
- {
- OnMenuCreated ();
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern int Menu_GetType (IntPtr handle);
- private StringHash UrhoGetType ()
- {
- Runtime.ValidateRefCounted (this);
- return new StringHash (Menu_GetType (handle));
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr Menu_GetTypeName (IntPtr handle);
- private string GetTypeName ()
- {
- Runtime.ValidateRefCounted (this);
- return Marshal.PtrToStringAnsi (Menu_GetTypeName (handle));
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern int Menu_GetTypeStatic ();
- private static StringHash GetTypeStatic ()
- {
- Runtime.Validate (typeof(Menu));
- return new StringHash (Menu_GetTypeStatic ());
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr Menu_GetTypeNameStatic ();
- private static string GetTypeNameStatic ()
- {
- Runtime.Validate (typeof(Menu));
- return Marshal.PtrToStringAnsi (Menu_GetTypeNameStatic ());
- }
- [Preserve]
- public Menu () : this (Application.CurrentContext)
- {
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr Menu_Menu (IntPtr context);
- [Preserve]
- public Menu (Context context) : base (UrhoObjectFlag.Empty)
- {
- Runtime.Validate (typeof(Menu));
- handle = Menu_Menu ((object)context == null ? IntPtr.Zero : context.Handle);
- Runtime.RegisterObject (this);
- OnMenuCreated ();
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Menu_RegisterObject (IntPtr context);
- /// <summary>
- /// Register object factory.
- /// </summary>
- public new static void RegisterObject (Context context)
- {
- Runtime.Validate (typeof(Menu));
- Menu_RegisterObject ((object)context == null ? IntPtr.Zero : context.Handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Menu_LoadXML (IntPtr handle, IntPtr source, IntPtr styleFile, bool setInstanceDefault);
- /// <summary>
- /// Load from XML data with style. Return true if successful.
- /// </summary>
- public override bool LoadXml (XmlElement source, Urho.Resources.XmlFile styleFile, bool setInstanceDefault = false)
- {
- Runtime.ValidateRefCounted (this);
- return Menu_LoadXML (handle, (object)source == null ? IntPtr.Zero : source.Handle, (object)styleFile == null ? IntPtr.Zero : styleFile.Handle, setInstanceDefault);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Menu_SaveXML (IntPtr handle, IntPtr dest);
- /// <summary>
- /// Save as XML data. Return true if successful.
- /// </summary>
- public override bool SaveXml (XmlElement dest)
- {
- Runtime.ValidateRefCounted (this);
- return Menu_SaveXML (handle, (object)dest == null ? IntPtr.Zero : dest.Handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Menu_Update (IntPtr handle, float timeStep);
- /// <summary>
- /// Perform UI element update.
- /// </summary>
- public override void Update (float timeStep)
- {
- Runtime.ValidateRefCounted (this);
- Menu_Update (handle, timeStep);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Menu_OnHover (IntPtr handle, ref Urho.IntVector2 position, ref Urho.IntVector2 screenPosition, int buttons, int qualifiers, IntPtr cursor);
- /// <summary>
- /// React to mouse hover.
- /// </summary>
- public override void OnHover (Urho.IntVector2 position, Urho.IntVector2 screenPosition, int buttons, int qualifiers, Cursor cursor)
- {
- Runtime.ValidateRefCounted (this);
- Menu_OnHover (handle, ref position, ref screenPosition, buttons, qualifiers, (object)cursor == null ? IntPtr.Zero : cursor.Handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Menu_OnShowPopup (IntPtr handle);
- /// <summary>
- /// React to the popup being shown.
- /// </summary>
- public virtual void OnShowPopup ()
- {
- Runtime.ValidateRefCounted (this);
- Menu_OnShowPopup (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Menu_OnHidePopup (IntPtr handle);
- /// <summary>
- /// React to the popup being hidden.
- /// </summary>
- public virtual void OnHidePopup ()
- {
- Runtime.ValidateRefCounted (this);
- Menu_OnHidePopup (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Menu_SetPopup (IntPtr handle, IntPtr element);
- /// <summary>
- /// Set popup element to show on selection.
- /// </summary>
- private void SetPopup (UIElement element)
- {
- Runtime.ValidateRefCounted (this);
- Menu_SetPopup (handle, (object)element == null ? IntPtr.Zero : element.Handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Menu_SetPopupOffset (IntPtr handle, ref Urho.IntVector2 offset);
- /// <summary>
- /// Set popup element offset.
- /// </summary>
- private void SetPopupOffset (Urho.IntVector2 offset)
- {
- Runtime.ValidateRefCounted (this);
- Menu_SetPopupOffset (handle, ref offset);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Menu_SetPopupOffset0 (IntPtr handle, int x, int y);
- /// <summary>
- /// Set popup element offset.
- /// </summary>
- public void SetPopupOffset (int x, int y)
- {
- Runtime.ValidateRefCounted (this);
- Menu_SetPopupOffset0 (handle, x, y);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Menu_ShowPopup (IntPtr handle, bool enable);
- /// <summary>
- /// Force the popup to show or hide.
- /// </summary>
- public void ShowPopup (bool enable)
- {
- Runtime.ValidateRefCounted (this);
- Menu_ShowPopup (handle, enable);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Menu_SetAccelerator (IntPtr handle, int key, int qualifiers);
- /// <summary>
- /// Set accelerator key (set zero key code to disable.)
- /// </summary>
- public void SetAccelerator (int key, int qualifiers)
- {
- Runtime.ValidateRefCounted (this);
- Menu_SetAccelerator (handle, key, qualifiers);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr Menu_GetPopup (IntPtr handle);
- /// <summary>
- /// Return popup element.
- /// </summary>
- private UIElement GetPopup ()
- {
- Runtime.ValidateRefCounted (this);
- return Runtime.LookupObject<UIElement> (Menu_GetPopup (handle));
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern Urho.IntVector2 Menu_GetPopupOffset (IntPtr handle);
- /// <summary>
- /// Return popup element offset.
- /// </summary>
- private Urho.IntVector2 GetPopupOffset ()
- {
- Runtime.ValidateRefCounted (this);
- return Menu_GetPopupOffset (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Menu_GetShowPopup (IntPtr handle);
- /// <summary>
- /// Return whether popup is open.
- /// </summary>
- private bool GetShowPopup ()
- {
- Runtime.ValidateRefCounted (this);
- return Menu_GetShowPopup (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern int Menu_GetAcceleratorKey (IntPtr handle);
- /// <summary>
- /// Return accelerator key code, 0 if disabled.
- /// </summary>
- private int GetAcceleratorKey ()
- {
- Runtime.ValidateRefCounted (this);
- return Menu_GetAcceleratorKey (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern int Menu_GetAcceleratorQualifiers (IntPtr handle);
- /// <summary>
- /// Return accelerator qualifiers.
- /// </summary>
- private int GetAcceleratorQualifiers ()
- {
- Runtime.ValidateRefCounted (this);
- return Menu_GetAcceleratorQualifiers (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>
- /// Return popup element.
- /// Or
- /// Set popup element to show on selection.
- /// </summary>
- public UIElement Popup {
- get {
- return GetPopup ();
- }
- set {
- SetPopup (value);
- }
- }
- /// <summary>
- /// Return popup element offset.
- /// Or
- /// Set popup element offset.
- /// </summary>
- public Urho.IntVector2 PopupOffset {
- get {
- return GetPopupOffset ();
- }
- set {
- SetPopupOffset (value);
- }
- }
- /// <summary>
- /// Return whether popup is open.
- /// </summary>
- public bool IsPopupShown {
- get {
- return GetShowPopup ();
- }
- }
- /// <summary>
- /// Return accelerator key code, 0 if disabled.
- /// </summary>
- public int AcceleratorKey {
- get {
- return GetAcceleratorKey ();
- }
- }
- /// <summary>
- /// Return accelerator qualifiers.
- /// </summary>
- public int AcceleratorQualifiers {
- get {
- return GetAcceleratorQualifiers ();
- }
- }
- }
- }
|