2004-02-24 Mike Kestner <mkestner@ximian.com>

* 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
This commit is contained in:
Mike Kestner 2004-02-24 18:00:40 +00:00
parent 9bd46f1374
commit 13f42d0b30
6 changed files with 106 additions and 8 deletions

View file

@ -1,3 +1,11 @@
2004-02-24 Mike Kestner <mkestner@ximian.com>
* 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 <mkestner@ximian.com>
* pango/Pango.metadata : mark some out params on Layout.

45
pango/AttrIterator.custom Normal file
View file

@ -0,0 +1,45 @@
// 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;
}
}

25
pango/GlyphItem.custom Normal file
View file

@ -0,0 +1,25 @@
// Pango.GlyphItem.custom - Pango GlyphItem 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 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;
}

View file

@ -1,12 +1,29 @@
// Pango.Layout.custom - Pango Layout class customizations
//
// Author: Pedro Abelleira Seco <pedroabelleira@yahoo.es>
// Authors: Pedro Abelleira Seco <pedroabelleira@yahoo.es>
// 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 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;
}
}
/// <summary> Size property </summary>
/// <remarks> Returns the size of the Layout </remarks>
public System.Drawing.Size Size {
get {
int width, height;

View file

@ -6,11 +6,14 @@
<attr path="/api/namespace/class[@cname='PangoGlobal']/method[@name='ReorderItems']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='PangoLayout']/method[@name='GetCursorPos']/*/*[@type='PangoRectangle*']" name="pass_as">out</attr>
<attr path="/api/namespace/object[@cname='PangoLayout']/method[@name='GetExtents']/*/*[@type='PangoRectangle*']" name="pass_as">out</attr>
<attr path="/api/namespace/object[@cname='PangoLayout']/method[@name='GetLines']/return-type" name="element_type">Pango.LayoutLine</attr>
<attr path="/api/namespace/object[@cname='PangoLayout']/method[@name='GetLines']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='PangoLayout']/method[@name='GetPixelExtents']/*/*[@type='PangoRectangle*']" name="pass_as">out</attr>
<attr path="/api/namespace/object[@cname='PangoLayout']/method[@name='GetPixelSize']/*/*[@type='int*']" name="pass_as">out</attr>
<attr path="/api/namespace/object[@cname='PangoLayout']/method[@name='GetSize']/*/*[@type='int*']" name="pass_as">out</attr>
<attr path="/api/namespace/object[@cname='PangoLayout']/method[@name='IndexToPos']/*/*[@type='PangoRectangle*']" name="pass_as">out</attr>
<attr path="/api/namespace/struct[@cname='PangoAttrIterator']/method[@name='GetAttrs']" name="hidden">1</attr>
<attr path="/api/namespace/struct[@cname='PangoAttrIterator']/method[@name='GetFont']" name="hidden">1</attr>
<attr path="/api/namespace/struct[@cname='PangoGlyphItem']/method[@name='ApplyAttrs']" name="hidden">1</attr>
<attr path="/api/namespace/struct[@cname='PangoLayoutLine']/method[@name='GetExtents']/*/*[@type='PangoRectangle*']" name="pass_as">ref</attr>
<attr path="/api/namespace/struct[@cname='PangoLayoutLine']/method[@name='GetExtents']/*/*[@type='PangoRectangle*']" name="null_ok">1</attr>
<attr path="/api/namespace/struct[@cname='PangoLayoutLine']/method[@name='GetPixelExtents']/*/*[@type='PangoRectangle*']" name="pass_as">ref</attr>

View file

@ -352,7 +352,7 @@
<method name="GetLineCount" cname="pango_layout_get_line_count">
<return-type type="int" />
</method>
<method name="GetLines" cname="pango_layout_get_lines">
<method name="GetLines" cname="pango_layout_get_lines" hidden="1">
<return-type type="GSList*" element_type="Pango.LayoutLine" />
</method>
<method name="GetLogAttrs" cname="pango_layout_get_log_attrs">
@ -583,10 +583,10 @@
<parameter type="PangoAttrType" name="type" />
</parameters>
</method>
<method name="GetAttrs" cname="pango_attr_iterator_get_attrs">
<method name="GetAttrs" cname="pango_attr_iterator_get_attrs" hidden="1">
<return-type type="GSList*" />
</method>
<method name="GetFont" cname="pango_attr_iterator_get_font">
<method name="GetFont" cname="pango_attr_iterator_get_font" hidden="1">
<return-type type="void" />
<parameters>
<parameter type="PangoFontDescription*" name="desc" />
@ -927,7 +927,7 @@
<struct name="GlyphItem" cname="PangoGlyphItem">
<field cname="item" type="PangoItem*" />
<field cname="glyphs" type="PangoGlyphString*" />
<method name="ApplyAttrs" cname="pango_glyph_item_apply_attrs">
<method name="ApplyAttrs" cname="pango_glyph_item_apply_attrs" hidden="1">
<return-type type="GSList*" />
<parameters>
<parameter type="const-char*" name="text" />