]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
gdk-3.0: Fix gdk_window_destroy binding
authorJürg Billeter <j@bitron.ch>
Mon, 16 May 2011 11:53:55 +0000 (13:53 +0200)
committerJürg Billeter <j@bitron.ch>
Sun, 29 May 2011 11:00:41 +0000 (13:00 +0200)
vala/valacodewriter.vala
vala/valamemberaccess.vala
vala/valamethod.vala
vapi/gdk-3.0.vapi
vapi/packages/gdk-3.0/gdk-3.0.metadata
vapigen/valagidlparser.vala

index 3eafe22e9e12bde042a25e558b672e6ee0e3de00..11c5871668065692dd8f167b6554b24633dd01d9 100644 (file)
@@ -1040,6 +1040,10 @@ public class Vala.CodeWriter : CodeVisitor {
                        write_indent ();
                        write_string ("[ReturnsModifiedPointer]");
                }
+               if (m.get_attribute ("DestroysInstance") != null) {
+                       write_indent ();
+                       write_string ("[DestroysInstance]");
+               }
                if (m.printf_format) {
                        write_indent ();
                        write_string ("[PrintfFormat]");
index 7f4b6dff08740fcbd935feef090e64d61d80ad70..180c3359ea8672e8499a89033a23a36804e8d221 100644 (file)
@@ -734,6 +734,7 @@ public class Vala.MemberAccess : Expression {
                        if (instance && inner == null) {
                                inner = new MemberAccess (null, "this", source_reference);
                                inner.value_type = this_parameter.variable_type.copy ();
+                               inner.value_type.value_owned = false;
                                inner.symbol_reference = this_parameter;
                        }
 
@@ -767,6 +768,7 @@ public class Vala.MemberAccess : Expression {
 
                                if (instance && base_method.parent_symbol is TypeSymbol) {
                                        inner.target_type = context.analyzer.get_data_type_for_symbol ((TypeSymbol) base_method.parent_symbol);
+                                       inner.target_type.value_owned = base_method.this_parameter.variable_type.value_owned;
                                }
                        } else if (symbol_reference is Property) {
                                var prop = (Property) symbol_reference;
index 82fca11b4be73587ddd0c71285466b5cac17ccc3..59ab103f456c2dfa23f95bd19272f1d203174b50 100644 (file)
@@ -497,6 +497,8 @@ public class Vala.Method : Subroutine {
                                get_error_types ().clear ();
                        } else if (a.name == "Experimental") {
                                process_experimental_attribute (a);
+                       } else if (a.name == "DestroysInstance") {
+                               this_parameter.variable_type.value_owned = true;
                        }
                }
        }
index fba20d42a4f6bfb544092199458b24dd614cabbc..ff16587f46d877b3a74ffe23b27491920b61f703 100644 (file)
@@ -320,6 +320,7 @@ namespace Gdk {
                public void coords_to_parent (double x, double y, double parent_x, double parent_y);
                public unowned Cairo.Surface create_similar_surface (Cairo.Content content, int width, int height);
                public void deiconify ();
+               [DestroysInstance]
                public void destroy ();
                public void enable_synchronized_configure ();
                public void end_paint ();
index 27cca223708b83b524764a86db0e30862339df60..a27f9a2d27eafa077b105c77a66c8f5d40f04f58 100644 (file)
@@ -136,6 +136,7 @@ gdk_window_at_pointer.win_x is_out="1"
 gdk_window_at_pointer.win_y is_out="1"
 gdk_window_constrain_size.new_width is_out="1"
 gdk_window_constrain_size.new_height is_out="1"
+gdk_window_destroy destroys_instance="1"
 gdk_window_get_decorations.decorations is_out="1"
 gdk_window_get_deskrelative_origin.x is_out="1"
 gdk_window_get_deskrelative_origin.y is_out="1"
index ca185ee4b6f7f4a312aa03cc3a6d0102ef3a806e..14d8a2c7888fdc9bf901d8ded0fc34661ce12048 100644 (file)
@@ -2033,6 +2033,10 @@ public class Vala.GIdlParser : CodeVisitor {
                                        if (eval (nv[1]) == "1") {
                                                return_type.value_owned = true;
                                        }
+                               } else if (nv[0] == "destroys_instance") {
+                                       if (eval (nv[1]) == "1") {
+                                               m.attributes.append (new Attribute ("DestroysInstance", m.source_reference));
+                                       }
                                } else if (nv[0] == "nullable") {
                                        if (eval (nv[1]) == "1") {
                                                return_type.nullable = true;