[vala] pango: Fix PangoAttrShape and PangoAttrDataCopyFunc bindings
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] pango: Fix PangoAttrShape and PangoAttrDataCopyFunc bindings
- Date: Tue, 28 Jun 2011 12:30:34 +0000 (UTC)
commit acab566573bbf896d912e107c6521c47764cffc8
Author: Alexander Larsson <alexl redhat com>
Date: Tue Jun 28 14:14:21 2011 +0200
pango: Fix PangoAttrShape and PangoAttrDataCopyFunc bindings
Fixes bug 653528.
vapi/packages/pango/pango.metadata | 10 +++++++++-
vapi/pango.vapi | 30 +++++++++++++++---------------
2 files changed, 24 insertions(+), 16 deletions(-)
---
diff --git a/vapi/packages/pango/pango.metadata b/vapi/packages/pango/pango.metadata
index ae10dae..cf10a7b 100644
--- a/vapi/packages/pango/pango.metadata
+++ b/vapi/packages/pango/pango.metadata
@@ -18,7 +18,15 @@ pango_attr_list_insert.attr transfer_ownership="1"
pango_attr_list_insert_before.attr transfer_ownership="1"
PangoAttrLanguage base_class="PangoAttribute" free_function="pango_attribute_destroy"
PangoAttrLanguage.attr hidden="1"
-PangoAttrShape base_class="PangoAttribute" free_function="pango_attribute_destroy"
+PangoAttrShape base_class="PangoAttribute" free_function="pango_attribute_destroy" type_parameters="T"
+PangoAttrShape.data type_name="T"
+PangoAttrShape.copy_func type_arguments="T"
+pango_attr_shape_new_with_data simple_generics="1"
+pango_attr_shape_new_with_data.data type_name="T" transfer_ownership="1"
+pango_attr_shape_new_with_data.copy_func type_arguments="T"
+pango_attr_shape_new_with_data.destroy_func hidden="1"
+PangoAttrDataCopyFunc type_parameters="T" type_name="T" transfer_ownership="1" has_target="0"
+PangoAttrDataCopyFunc.data hidden="0" type_name="T"
PangoAttrSize.attr hidden="1"
PangoAttrSize base_class="PangoAttribute" free_function="pango_attribute_destroy"
PangoAttrSize.attr hidden="1"
diff --git a/vapi/pango.vapi b/vapi/pango.vapi
index 8d183a9..0cead92 100644
--- a/vapi/pango.vapi
+++ b/vapi/pango.vapi
@@ -28,24 +28,24 @@ namespace Pango {
public Pango.AttrType type;
}
[Compact]
- [CCode (free_function = "pango_attribute_destroy", cheader_filename = "pango/pango.h")]
+ [CCode (cheader_filename = "pango/pango.h")]
public class AttrColor : Pango.Attribute {
public Pango.Color color;
}
[Compact]
- [CCode (free_function = "pango_attribute_destroy", cheader_filename = "pango/pango.h")]
+ [CCode (cheader_filename = "pango/pango.h")]
public class AttrFloat : Pango.Attribute {
public double value;
}
[Compact]
- [CCode (free_function = "pango_attribute_destroy", cheader_filename = "pango/pango.h")]
+ [CCode (cheader_filename = "pango/pango.h")]
public class AttrFontDesc : Pango.Attribute {
public weak Pango.FontDescription desc;
[CCode (type = "PangoAttribute*", has_construct_function = false)]
public AttrFontDesc (Pango.FontDescription desc);
}
[Compact]
- [CCode (free_function = "pango_attribute_destroy", cheader_filename = "pango/pango.h")]
+ [CCode (cheader_filename = "pango/pango.h")]
public class AttrInt : Pango.Attribute {
public int value;
}
@@ -60,7 +60,7 @@ namespace Pango {
public void range (out int start, out int end);
}
[Compact]
- [CCode (free_function = "pango_attribute_destroy", cheader_filename = "pango/pango.h")]
+ [CCode (cheader_filename = "pango/pango.h")]
public class AttrLanguage : Pango.Attribute {
public weak Pango.Language value;
[CCode (type = "PangoAttribute*", has_construct_function = false)]
@@ -80,21 +80,21 @@ namespace Pango {
public void splice (Pango.AttrList other, int pos, int len);
}
[Compact]
- [CCode (free_function = "pango_attribute_destroy", cheader_filename = "pango/pango.h")]
- public class AttrShape : Pango.Attribute {
+ [CCode (cheader_filename = "pango/pango.h")]
+ public class AttrShape<T> : Pango.Attribute {
public weak Pango.Attribute attr;
- public weak Pango.AttrDataCopyFunc copy_func;
- public void* data;
+ public weak Pango.AttrDataCopyFunc<T> copy_func;
+ public T data;
public weak GLib.DestroyNotify destroy_func;
public Pango.Rectangle ink_rect;
public Pango.Rectangle logical_rect;
[CCode (type = "PangoAttribute*", has_construct_function = false)]
public AttrShape (Pango.Rectangle ink_rect, Pango.Rectangle logical_rect);
- [CCode (type = "PangoAttribute*", has_construct_function = false)]
- public AttrShape.with_data (Pango.Rectangle ink_rect, Pango.Rectangle logical_rect, void* data, Pango.AttrDataCopyFunc copy_func, GLib.DestroyNotify destroy_func);
+ [CCode (type = "PangoAttribute*", simple_generics = true, has_construct_function = false)]
+ public AttrShape.with_data (Pango.Rectangle ink_rect, Pango.Rectangle logical_rect, owned T data, Pango.AttrDataCopyFunc<T> copy_func);
}
[Compact]
- [CCode (free_function = "pango_attribute_destroy", cheader_filename = "pango/pango.h")]
+ [CCode (cheader_filename = "pango/pango.h")]
public class AttrSize : Pango.Attribute {
public uint absolute;
public int size;
@@ -102,7 +102,7 @@ namespace Pango {
public AttrSize (int size);
}
[Compact]
- [CCode (free_function = "pango_attribute_destroy", cheader_filename = "pango/pango.h")]
+ [CCode (cheader_filename = "pango/pango.h")]
public class AttrString : Pango.Attribute {
public weak string value;
}
@@ -827,8 +827,8 @@ namespace Pango {
CHAR,
WORD_CHAR
}
- [CCode (cheader_filename = "pango/pango.h")]
- public delegate void* AttrDataCopyFunc ();
+ [CCode (cheader_filename = "pango/pango.h", has_target = false)]
+ public delegate T AttrDataCopyFunc<T> (T data);
[CCode (cheader_filename = "pango/pango.h")]
public delegate bool AttrFilterFunc (Pango.Attribute attribute);
[CCode (cheader_filename = "pango/pango.h")]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]