[vala] gdk-3.0: Fix gdk_window_destroy binding
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] gdk-3.0: Fix gdk_window_destroy binding
- Date: Mon, 16 May 2011 11:54:32 +0000 (UTC)
commit 98d23a30c287c22e124fa2a6db1ceff463d5d195
Author: Jürg Billeter <j bitron ch>
Date: Mon May 16 13:53:55 2011 +0200
gdk-3.0: Fix gdk_window_destroy binding
vala/valacodewriter.vala | 4 ++++
vala/valamemberaccess.vala | 2 ++
vala/valamethod.vala | 2 ++
vapi/gdk-3.0.vapi | 1 +
vapi/packages/gdk-3.0/gdk-3.0.metadata | 1 +
vapigen/valagidlparser.vala | 4 ++++
6 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/vala/valacodewriter.vala b/vala/valacodewriter.vala
index 0cdec76..9da08e3 100644
--- a/vala/valacodewriter.vala
+++ b/vala/valacodewriter.vala
@@ -1046,6 +1046,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]");
diff --git a/vala/valamemberaccess.vala b/vala/valamemberaccess.vala
index d7f66cd..a40cf7d 100644
--- a/vala/valamemberaccess.vala
+++ b/vala/valamemberaccess.vala
@@ -750,6 +750,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;
}
@@ -783,6 +784,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;
diff --git a/vala/valamethod.vala b/vala/valamethod.vala
index d974db1..5c1b39e 100644
--- a/vala/valamethod.vala
+++ b/vala/valamethod.vala
@@ -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;
}
}
}
diff --git a/vapi/gdk-3.0.vapi b/vapi/gdk-3.0.vapi
index fba20d4..ff16587 100644
--- a/vapi/gdk-3.0.vapi
+++ b/vapi/gdk-3.0.vapi
@@ -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 ();
diff --git a/vapi/packages/gdk-3.0/gdk-3.0.metadata b/vapi/packages/gdk-3.0/gdk-3.0.metadata
index 27cca22..a27f9a2 100644
--- a/vapi/packages/gdk-3.0/gdk-3.0.metadata
+++ b/vapi/packages/gdk-3.0/gdk-3.0.metadata
@@ -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"
diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala
index cca68a4..6fe0dc5 100644
--- a/vapigen/valagidlparser.vala
+++ b/vapigen/valagidlparser.vala
@@ -2069,6 +2069,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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]