public GtkSourceView.SourceLanguage GetLanguageFromMimeType(string mime_type) { IntPtr native_mime_type = GLib.Marshaller.StringToPtrGStrdup(mime_type); IntPtr raw_ret = gtk_source_languages_manager_get_language_from_mime_type(Handle, native_mime_type); GtkSourceView.SourceLanguage ret = GLib.Object.GetObject(raw_ret) as GtkSourceView.SourceLanguage; GLib.Marshaller.Free(native_mime_type); return(ret); }
public SourceBuffer(GtkSourceView.SourceLanguage language) : base(IntPtr.Zero) { if (GetType() != typeof(SourceBuffer)) { var vals = new GLib.Value[1]; var names = new IntPtr[1]; var param_count = 0; if (language != null) { names[param_count] = GLib.Marshaller.StringToPtrGStrdup("language"); vals[param_count++] = new GLib.Value(language); } CreateNativeObject(names, vals, param_count); return; } owned = true; Raw = gtk_source_buffer_new_with_language(language == null ? IntPtr.Zero : language.Handle); }