// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Sexy { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code public class SpellEntry : Gtk.Entry { ~SpellEntry() { Dispose(); } public SpellEntry(IntPtr raw) : base(raw) {} [DllImport("libsexy")] static extern IntPtr sexy_spell_entry_new(); public SpellEntry () : base (IntPtr.Zero) { if (GetType () != typeof (SpellEntry)) { CreateNativeObject (new string [0], new GLib.Value[0]); return; } Raw = sexy_spell_entry_new(); } [GLib.CDeclCallback] delegate bool WordCheckSignalDelegate (IntPtr arg0, IntPtr arg1, IntPtr gch); static bool WordCheckSignalCallback (IntPtr arg0, IntPtr arg1, IntPtr gch) { GLib.Signal sig = ((GCHandle) gch).Target as GLib.Signal; if (sig == null) throw new Exception("Unknown signal GC handle received " + gch); Sexy.WordCheckArgs args = new Sexy.WordCheckArgs (); args.Args = new object[1]; args.Args[0] = GLib.Marshaller.Utf8PtrToString (arg1); Sexy.WordCheckHandler handler = (Sexy.WordCheckHandler) sig.Handler; handler (GLib.Object.GetObject (arg0), args); if (args.RetVal == null) return false; return ((bool)args.RetVal); } [GLib.CDeclCallback] delegate bool WordCheckVMDelegate (IntPtr entry, IntPtr word); static WordCheckVMDelegate WordCheckVMCallback; static bool wordcheck_cb (IntPtr entry, IntPtr word) { SpellEntry entry_managed = GLib.Object.GetObject (entry, false) as SpellEntry; return entry_managed.OnWordCheck (GLib.Marshaller.Utf8PtrToString (word)); } private static void OverrideWordCheck (GLib.GType gtype) { if (WordCheckVMCallback == null) WordCheckVMCallback = new WordCheckVMDelegate (wordcheck_cb); OverrideVirtualMethod (gtype, "word_check", WordCheckVMCallback); } [GLib.DefaultSignalHandler(Type=typeof(Sexy.SpellEntry), ConnectionMethod="OverrideWordCheck")] protected virtual bool OnWordCheck (string word) { GLib.Value ret = new GLib.Value (GLib.GType.Boolean); GLib.ValueArray inst_and_params = new GLib.ValueArray (2); GLib.Value[] vals = new GLib.Value [2]; vals [0] = new GLib.Value (this); inst_and_params.Append (vals [0]); vals [1] = new GLib.Value (word); inst_and_params.Append (vals [1]); g_signal_chain_from_overridden (inst_and_params.ArrayPtr, ref ret); foreach (GLib.Value v in vals) v.Dispose (); return (bool) ret; } [GLib.Signal("word_check")] public event Sexy.WordCheckHandler WordCheck { add { GLib.Signal sig = GLib.Signal.Lookup (this, "word_check", new WordCheckSignalDelegate(WordCheckSignalCallback)); sig.AddDelegate (value); } remove { GLib.Signal sig = GLib.Signal.Lookup (this, "word_check", new WordCheckSignalDelegate(WordCheckSignalCallback)); sig.RemoveDelegate (value); } } [DllImport("libsexy")] static extern unsafe bool sexy_spell_entry_activate_language(IntPtr raw, IntPtr lang, out IntPtr error); public unsafe bool ActivateLanguage(string lang) { IntPtr lang_as_native = GLib.Marshaller.StringToPtrGStrdup (lang); IntPtr error = IntPtr.Zero; bool raw_ret = sexy_spell_entry_activate_language(Handle, lang_as_native, out error); bool ret = raw_ret; GLib.Marshaller.Free (lang_as_native); if (error != IntPtr.Zero) throw new GLib.GException (error); return ret; } [DllImport("libsexy")] static extern IntPtr sexy_spell_entry_get_language_name(IntPtr raw, IntPtr lang); public string GetLanguageName(string lang) { IntPtr lang_as_native = GLib.Marshaller.StringToPtrGStrdup (lang); IntPtr raw_ret = sexy_spell_entry_get_language_name(Handle, lang_as_native); string ret = GLib.Marshaller.PtrToStringGFree(raw_ret); GLib.Marshaller.Free (lang_as_native); return ret; } [DllImport("libsexy")] static extern bool sexy_spell_entry_is_checked(IntPtr raw); public bool IsChecked { get { bool raw_ret = sexy_spell_entry_is_checked(Handle); bool ret = raw_ret; return ret; } } [DllImport("libsexy")] static extern IntPtr sexy_spell_entry_get_type(); public static new GLib.GType GType { get { IntPtr raw_ret = sexy_spell_entry_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } [DllImport("libsexy")] static extern bool sexy_spell_entry_language_is_active(IntPtr raw, IntPtr lang); public bool LanguageIsActive(string lang) { IntPtr lang_as_native = GLib.Marshaller.StringToPtrGStrdup (lang); bool raw_ret = sexy_spell_entry_language_is_active(Handle, lang_as_native); bool ret = raw_ret; GLib.Marshaller.Free (lang_as_native); return ret; } [DllImport("libsexy")] static extern IntPtr sexy_spell_entry_get_languages(IntPtr raw); public GLib.SList Languages { get { IntPtr raw_ret = sexy_spell_entry_get_languages(Handle); GLib.SList ret = new GLib.SList(raw_ret); return ret; } } [DllImport("libsexy")] static extern void sexy_spell_entry_deactivate_language(IntPtr raw, IntPtr lang); public void DeactivateLanguage(string lang) { IntPtr lang_as_native = GLib.Marshaller.StringToPtrGStrdup (lang); sexy_spell_entry_deactivate_language(Handle, lang_as_native); GLib.Marshaller.Free (lang_as_native); } [DllImport("libsexy")] static extern void sexy_spell_entry_set_checked(IntPtr raw, bool is_checked); public bool Checked { set { sexy_spell_entry_set_checked(Handle, value); } } #endregion } }