mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-08 07:53:17 +02:00
![Mike Kestner](/assets/img/avatar_default.png)
* pango/AttrIterator.custom : manually implement SList method. * pango/GlyphItem.custom : manually implement SList method. * pango/Layout.custom : manually implement SList method. * pango/Pango.metadata : hide some SList methods. * pango/pango-api.xml : regen. svn path=/trunk/gtk-sharp/; revision=23410
46 lines
1.5 KiB
Plaintext
46 lines
1.5 KiB
Plaintext
// Pango.AttrIterator.custom - Pango AttrIterator class customizations
|
|
//
|
|
// Author: Mike Kestner <mkestner@ximian.com>
|
|
//
|
|
// Copyright (c) 2004 Novell, Inc.
|
|
//
|
|
// This code is inserted after the automatically generated code.
|
|
|
|
|
|
[DllImport("libpango-1.0-0.dll")]
|
|
static extern void pango_attr_iterator_get_font(IntPtr raw, IntPtr desc, out IntPtr language, out IntPtr extra_attrs);
|
|
|
|
public void GetFont (out Pango.FontDescription desc, out Pango.Language language, out Pango.Attribute[] extra_attrs)
|
|
{
|
|
desc = new FontDescription ();
|
|
IntPtr language_handle, list_handle;
|
|
pango_attr_iterator_get_font (Handle, desc.Handle, out language_handle, out list_handle);
|
|
language = language_handle == IntPtr.Zero ? null : new Language (language_handle);
|
|
if (list_handle == IntPtr.Zero) {
|
|
extra_attrs = new Pango.Attribute [0];
|
|
return;
|
|
}
|
|
GLib.SList list = new GLib.SList (list_handle);
|
|
extra_attrs = new Pango.Attribute [list.Count];
|
|
int i = 0;
|
|
foreach (Pango.Attribute attr in list)
|
|
extra_attrs [i++] = attr;
|
|
}
|
|
|
|
[DllImport("libpango-1.0-0.dll")]
|
|
static extern IntPtr pango_attr_iterator_get_attrs (IntPtr raw);
|
|
|
|
public Pango.Attribute[] Attrs {
|
|
get {
|
|
IntPtr list_handle = pango_attr_iterator_get_attrs (Handle);
|
|
if (list_handle == IntPtr.Zero)
|
|
return new Pango.Attribute [0];
|
|
GLib.SList list = new GLib.SList (list_handle);
|
|
Pango.Attribute[] attrs = new Pango.Attribute [list.Count];
|
|
int i = 0;
|
|
foreach (Pango.Attribute attr in list)
|
|
attrs [i++] = attr;
|
|
return attrs;
|
|
}
|
|
}
|