diff --git a/ChangeLog b/ChangeLog index f33ea6a09..5c47941ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-02-24 Mike Kestner + + * 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. + 2004-02-23 Mike Kestner * pango/Pango.metadata : mark some out params on Layout. diff --git a/pango/AttrIterator.custom b/pango/AttrIterator.custom new file mode 100644 index 000000000..f43722e0d --- /dev/null +++ b/pango/AttrIterator.custom @@ -0,0 +1,45 @@ +// Pango.AttrIterator.custom - Pango AttrIterator class customizations +// +// Author: Mike Kestner +// +// 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; + } + } diff --git a/pango/GlyphItem.custom b/pango/GlyphItem.custom new file mode 100644 index 000000000..8d3c0c27f --- /dev/null +++ b/pango/GlyphItem.custom @@ -0,0 +1,25 @@ +// Pango.GlyphItem.custom - Pango GlyphItem class customizations +// +// Author: Mike Kestner +// +// Copyright (c) 2004 Novell, Inc. +// +// This code is inserted after the automatically generated code. + + + [DllImport("libpango-1.0-0.dll")] + static extern IntPtr pango_glyph_item_apply_attrs(ref Pango.GlyphItem raw, string text, IntPtr list); + + public GlyphItem[] ApplyAttrs (string text, Pango.AttrList list) + { + IntPtr list_handle = pango_glyph_item_apply_attrs (ref this, text, list.Handle); + if (list_handle == IntPtr.Zero) + return new GlyphItem [0]; + GLib.SList item_list = new GLib.SList (list_handle, typeof (GlyphItem)); + GlyphItem[] result = new GlyphItem [item_list.Count]; + int i = 0; + foreach (GlyphItem item in item_list) + result [i++] = item; + return result; + } + diff --git a/pango/Layout.custom b/pango/Layout.custom index 921496749..95404d094 100644 --- a/pango/Layout.custom +++ b/pango/Layout.custom @@ -1,12 +1,29 @@ // Pango.Layout.custom - Pango Layout class customizations // -// Author: Pedro Abelleira Seco +// Authors: Pedro Abelleira Seco +// Mike Kestner +// +// Copyright (c) 2004 Novell, Inc. // // This code is inserted after the automatically generated code. +[DllImport("libpango-1.0-0.dll")] +static extern IntPtr pango_layout_get_lines(IntPtr raw); + +public LayoutLine[] Lines { + get { + IntPtr list_ptr = pango_layout_get_lines(Handle); + if (list_ptr == IntPtr.Zero) + return new LayoutLine [0]; + GLib.SList list = new GLib.SList(list_ptr, typeof (Pango.LayoutLine)); + LayoutLine[] result = new LayoutLine [list.Count]; + int i = 0; + foreach (LayoutLine line in list) + result [i] = line; + return result; + } +} -/// Size property -/// Returns the size of the Layout public System.Drawing.Size Size { get { int width, height; diff --git a/pango/Pango.metadata b/pango/Pango.metadata index 0a8d01466..fea516d88 100644 --- a/pango/Pango.metadata +++ b/pango/Pango.metadata @@ -6,11 +6,14 @@ 1 out out - Pango.LayoutLine + 1 out out out out + 1 + 1 + 1 ref 1 ref diff --git a/pango/pango-api.xml b/pango/pango-api.xml index 52814bb9e..4fa4f0d77 100644 --- a/pango/pango-api.xml +++ b/pango/pango-api.xml @@ -352,7 +352,7 @@ - + @@ -583,10 +583,10 @@ - + - +