]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
pango: fix Pango.Attribute constructors' transfer of ownership and Pango.Scale
authorPhilipp Zabel <philipp.zabel@gmail.com>
Fri, 6 Nov 2009 18:43:24 +0000 (19:43 +0100)
committerEvan Nemerson <evan@coeus-group.com>
Sat, 7 Nov 2009 19:59:55 +0000 (11:59 -0800)
The Pango.attr_*_new constructors return owned Pango.Attribute references.
Pango.Scale is not an enum. Turn it into a namespace with double constants.
The latter is needed so for Pango.attr_scale_new, because it is impossible
to convert from enum Pango.Scale to double.

Fixes bug 600993.

vapi/packages/pango/pango-custom.vala
vapi/packages/pango/pango.metadata
vapi/pango.vapi

index f8f989317ef701eff8f06f5307ffcb9be56c92e6..5da8cf64aca2d5c653b18655fcb6e0daebc182b8 100644 (file)
  */
 
 namespace Pango {
-       [CCode (cprefix = "PANGO_SCALE_", cheader_filename = "pango/pango.h")]
-       public enum Scale {
-               XX_SMALL,
-               X_SMALL,
-               SMALL,
-               MEDIUM,
-               LARGE,
-               X_LARGE,
-               XX_LARGE
+       [CCode (cheader_filename = "pango/pango.h")]
+       namespace Scale {
+               [CCode (cname = "PANGO_SCALE_XX_SMALL")]
+               public const double XX_SMALL;
+               [CCode (cname = "PANGO_SCALE_X_SMALL")]
+               public const double X_SMALL;
+               [CCode (cname = "PANGO_SCALE_SMALL")]
+               public const double SMALL;
+               [CCode (cname = "PANGO_SCALE_MEDIUM")]
+               public const double MEDIUM;
+               [CCode (cname = "PANGO_SCALE_LARGE")]
+               public const double LARGE;
+               [CCode (cname = "PANGO_SCALE_X_LARGE")]
+               public const double X_LARGE;
+               [CCode (cname = "PANGO_SCALE_XX_LARGE")]
+               public const double XX_LARGE;
        }
 }
index d2da5715890071b913e89933913bad95d4d5ad5e..74023392e10b4fb4a489a01c2d8840e7399c7c71 100644 (file)
@@ -18,6 +18,24 @@ PangoAttrSize base_class="PangoAttribute" free_function="pango_attribute_destroy
 PangoAttrSize.attr hidden="1"
 PangoAttrString base_class="PangoAttribute" free_function="pango_attribute_destroy"
 PangoAttrString.attr hidden="1"
+pango_attr_background_new transfer_ownership="1"
+pango_attr_fallback_new transfer_ownership="1"
+pango_attr_family_new transfer_ownership="1"
+pango_attr_foreground_new transfer_ownership="1"
+pango_attr_gravity_hint_new transfer_ownership="1"
+pango_attr_gravity_new transfer_ownership="1"
+pango_attr_letter_spacing_new transfer_ownership="1"
+pango_attr_rise_new transfer_ownership="1"
+pango_attr_scale_new transfer_ownership="1"
+pango_attr_stretch_new transfer_ownership="1"
+pango_attr_font_desc_new transfer_ownership="1"
+pango_attr_strikethrough_color_new transfer_ownership="1"
+pango_attr_strikethrough_new transfer_ownership="1"
+pango_attr_style_new transfer_ownership="1"
+pango_attr_underline_color_new transfer_ownership="1"
+pango_attr_underline_new transfer_ownership="1"
+pango_attr_variant_new transfer_ownership="1"
+pango_attr_weight_new transfer_ownership="1"
 pango_attr_iterator_copy transfer_ownership="1"
 pango_coverage_copy transfer_ownership="1"
 pango_font_description_copy transfer_ownership="1"
index 0fb6ecbaa522bbec2dd8fc5f9d026a8da2106baa..ede08180e47d78c63fac679cafbaa971ef5062d6 100644 (file)
@@ -2,6 +2,23 @@
 
 [CCode (cprefix = "Pango", lower_case_cprefix = "pango_")]
 namespace Pango {
+       [CCode (cprefix = "PangoScale", lower_case_cprefix = "pango_scale_")]
+       namespace Scale {
+               [CCode (cheader_filename = "pango/pango.h")]
+               public const double LARGE;
+               [CCode (cheader_filename = "pango/pango.h")]
+               public const double MEDIUM;
+               [CCode (cheader_filename = "pango/pango.h")]
+               public const double SMALL;
+               [CCode (cheader_filename = "pango/pango.h")]
+               public const double XX_LARGE;
+               [CCode (cheader_filename = "pango/pango.h")]
+               public const double XX_SMALL;
+               [CCode (cheader_filename = "pango/pango.h")]
+               public const double X_LARGE;
+               [CCode (cheader_filename = "pango/pango.h")]
+               public const double X_SMALL;
+       }
        [Compact]
        [CCode (cheader_filename = "pango/pango.h")]
        public class Analysis {
@@ -658,16 +675,6 @@ namespace Pango {
                UNDERLINE,
                STRIKETHROUGH
        }
-       [CCode (cprefix = "PANGO_SCALE_", cheader_filename = "pango/pango.h")]
-       public enum Scale {
-               XX_SMALL,
-               X_SMALL,
-               SMALL,
-               MEDIUM,
-               LARGE,
-               X_LARGE,
-               XX_LARGE
-       }
        [CCode (cprefix = "PANGO_SCRIPT_", cheader_filename = "pango/pango.h")]
        public enum Script {
                INVALID_CODE,
@@ -836,43 +843,43 @@ namespace Pango {
        [CCode (cheader_filename = "pango/pango.h")]
        public const string VERSION_STRING;
        [CCode (cheader_filename = "pango/pango.h")]
-       public static unowned Pango.Attribute attr_background_new (uint16 red, uint16 green, uint16 blue);
+       public static Pango.Attribute attr_background_new (uint16 red, uint16 green, uint16 blue);
        [CCode (cheader_filename = "pango/pango.h")]
-       public static unowned Pango.Attribute attr_fallback_new (bool enable_fallback);
+       public static Pango.Attribute attr_fallback_new (bool enable_fallback);
        [CCode (cheader_filename = "pango/pango.h")]
-       public static unowned Pango.Attribute attr_family_new (string family);
+       public static Pango.Attribute attr_family_new (string family);
        [CCode (cheader_filename = "pango/pango.h")]
-       public static unowned Pango.Attribute attr_foreground_new (uint16 red, uint16 green, uint16 blue);
+       public static Pango.Attribute attr_foreground_new (uint16 red, uint16 green, uint16 blue);
        [CCode (cheader_filename = "pango/pango.h")]
-       public static unowned Pango.Attribute attr_gravity_hint_new (Pango.GravityHint hint);
+       public static Pango.Attribute attr_gravity_hint_new (Pango.GravityHint hint);
        [CCode (cheader_filename = "pango/pango.h")]
-       public static unowned Pango.Attribute attr_gravity_new (Pango.Gravity gravity);
+       public static Pango.Attribute attr_gravity_new (Pango.Gravity gravity);
        [CCode (cheader_filename = "pango/pango.h")]
-       public static unowned Pango.Attribute attr_letter_spacing_new (int letter_spacing);
+       public static Pango.Attribute attr_letter_spacing_new (int letter_spacing);
        [CCode (cheader_filename = "pango/pango.h")]
-       public static unowned Pango.Attribute attr_rise_new (int rise);
+       public static Pango.Attribute attr_rise_new (int rise);
        [CCode (cheader_filename = "pango/pango.h")]
-       public static unowned Pango.Attribute attr_scale_new (double scale_factor);
+       public static Pango.Attribute attr_scale_new (double scale_factor);
        [CCode (cheader_filename = "pango/pango.h")]
-       public static unowned Pango.Attribute attr_stretch_new (Pango.Stretch stretch);
+       public static Pango.Attribute attr_stretch_new (Pango.Stretch stretch);
        [CCode (cheader_filename = "pango/pango.h")]
-       public static unowned Pango.Attribute attr_strikethrough_color_new (uint16 red, uint16 green, uint16 blue);
+       public static Pango.Attribute attr_strikethrough_color_new (uint16 red, uint16 green, uint16 blue);
        [CCode (cheader_filename = "pango/pango.h")]
-       public static unowned Pango.Attribute attr_strikethrough_new (bool strikethrough);
+       public static Pango.Attribute attr_strikethrough_new (bool strikethrough);
        [CCode (cheader_filename = "pango/pango.h")]
-       public static unowned Pango.Attribute attr_style_new (Pango.Style style);
+       public static Pango.Attribute attr_style_new (Pango.Style style);
        [CCode (cheader_filename = "pango/pango.h")]
        public static unowned string attr_type_get_name (Pango.AttrType type);
        [CCode (cheader_filename = "pango/pango.h")]
        public static Pango.AttrType attr_type_register (string name);
        [CCode (cheader_filename = "pango/pango.h")]
-       public static unowned Pango.Attribute attr_underline_color_new (uint16 red, uint16 green, uint16 blue);
+       public static Pango.Attribute attr_underline_color_new (uint16 red, uint16 green, uint16 blue);
        [CCode (cheader_filename = "pango/pango.h")]
-       public static unowned Pango.Attribute attr_underline_new (Pango.Underline underline);
+       public static Pango.Attribute attr_underline_new (Pango.Underline underline);
        [CCode (cheader_filename = "pango/pango.h")]
-       public static unowned Pango.Attribute attr_variant_new (Pango.Variant variant);
+       public static Pango.Attribute attr_variant_new (Pango.Variant variant);
        [CCode (cheader_filename = "pango/pango.h")]
-       public static unowned Pango.Attribute attr_weight_new (Pango.Weight weight);
+       public static Pango.Attribute attr_weight_new (Pango.Weight weight);
        [CCode (cheader_filename = "pango/pango.h")]
        public static Pango.BidiType bidi_type_for_unichar (unichar ch);
        [CCode (cheader_filename = "pango/pango.h")]