Commit 3c0ec04e authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter

generalize symbol resolving to fully support inner types

2008-02-24  Juerg Billeter  <j@bitron.ch>

	* vala/parser.y, vala/vala.h, vala/valasymbolresolver.vala,
	  vala/valaunresolvedsymbol.vala, vala/valaunresolvedtype.vala:
	  generalize symbol resolving to fully support inner types

	* vala/Makefile.am: update

	* vapigen/valagidlparser.vala, vapi/packages/gtk+-2.0/: adapt to
	  new symbol resolving

	* vapi/atk.vapi, vapi/gdk-2.0.vapi, vapi/glib-2.0.vapi,
	  vapi/gnome-desktop-2.0.vapi, vapi/gnome-vfs-2.0.vapi,
	  vapi/gstreamer-0.10.vapi, vapi/gtk+-2.0.vapi,
	  vapi/libglade-2.0.vapi, vapi/libgnomeui-2.0.vapi,
	  vapi/webkit-1.0.vapi: regenerated

svn path=/trunk/; revision=1049
parent 4dbdb2eb
2008-02-24 Jürg Billeter <j@bitron.ch>
* vala/parser.y, vala/vala.h, vala/valasymbolresolver.vala,
vala/valaunresolvedsymbol.vala, vala/valaunresolvedtype.vala:
generalize symbol resolving to fully support inner types
* vala/Makefile.am: update
* vapigen/valagidlparser.vala, vapi/packages/gtk+-2.0/: adapt to
new symbol resolving
* vapi/atk.vapi, vapi/gdk-2.0.vapi, vapi/glib-2.0.vapi,
vapi/gnome-desktop-2.0.vapi, vapi/gnome-vfs-2.0.vapi,
vapi/gstreamer-0.10.vapi, vapi/gtk+-2.0.vapi,
vapi/libglade-2.0.vapi, vapi/libgnomeui-2.0.vapi,
vapi/webkit-1.0.vapi: regenerated
2008-02-24 Raffaele Sandrini <raffaele@sandrini.ch>
* gobject/valaccodegenerator.vala: fix gerror_type handling
......
......@@ -131,6 +131,7 @@ libvalacore_la_VALASOURCES = \
valatypeparameter.vala \
valatypesymbol.vala \
valaunaryexpression.vala \
valaunresolvedsymbol.vala \
valaunresolvedtype.vala \
valavaluetype.vala \
valavariabledeclarator.vala \
......
......@@ -72,6 +72,7 @@ static gboolean check_is_struct (ValaSymbol *symbol, ValaSourceReference *src);
char *str;
GList *list;
ValaLiteral *literal;
ValaUnresolvedSymbol *unresolved_symbol;
ValaDataType *type_reference;
ValaExpression *expression;
ValaStatement *statement;
......@@ -228,6 +229,7 @@ static gboolean check_is_struct (ValaSymbol *symbol, ValaSourceReference *src);
%type <literal> literal
%type <literal> boolean_literal
%type <num> stars
%type <unresolved_symbol> symbol_name
%type <type_reference> type_name
%type <type_reference> type
%type <list> opt_argument_list
......@@ -538,33 +540,36 @@ compilation_unit
: opt_using_directives opt_outer_declarations
;
type_name
: identifier opt_type_argument_list
symbol_name
: identifier
{
GList *l;
ValaSourceReference *src = src(@1);
$$ = VALA_DATA_TYPE (vala_unresolved_type_new_from_name (NULL, $1, src));
ValaSourceReference *src = src(@1);
$$ = vala_unresolved_symbol_new (NULL, $1, src);
g_free ($1);
g_object_unref (src);
for (l = $2; l != NULL; l = l->next) {
vala_data_type_add_type_argument (VALA_DATA_TYPE ($$), l->data);
g_object_unref (l->data);
}
g_list_free ($2);
}
| identifier DOT identifier opt_type_argument_list
| symbol_name DOT identifier
{
GList *l;
ValaSourceReference *src = src(@1);
$$ = VALA_DATA_TYPE (vala_unresolved_type_new_from_name ($1, $3, src));
g_free ($1);
ValaSourceReference *src = src(@1);
$$ = vala_unresolved_symbol_new ($1, $3, src);
g_free ($3);
g_object_unref (src);
for (l = $4; l != NULL; l = l->next) {
}
;
type_name
: symbol_name opt_type_argument_list
{
GList *l;
ValaSourceReference *src = src(@1);
$$ = VALA_DATA_TYPE (vala_unresolved_type_new_from_symbol ($1, src));
g_object_unref ($1);
g_object_unref (src);
for (l = $2; l != NULL; l = l->next) {
vala_data_type_add_type_argument (VALA_DATA_TYPE ($$), l->data);
g_object_unref (l->data);
}
g_list_free ($4);
g_list_free ($2);
}
;
......@@ -3135,7 +3140,7 @@ method_declaration
method_header
: comment opt_attributes opt_access_modifier opt_modifiers type identifier OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS opt_throws_declaration opt_requires_declarations opt_ensures_declarations
{
GList *l;
GList *l;
ValaSourceReference *src;
ValaModifier vmodifiers;
......@@ -3215,14 +3220,16 @@ method_header
$$ = NULL;
}
}
| comment opt_attributes opt_access_modifier opt_modifiers identifier opt_name_specifier OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS opt_throws_declaration
| comment opt_attributes opt_access_modifier opt_modifiers symbol_name OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS opt_throws_declaration
{
GList *l;
ValaSourceReference *src = src_com(@5, $1);
$$ = VALA_METHOD (vala_code_context_create_creation_method (context, $5, $6, src));
g_free ($5);
g_free ($6);
if (vala_unresolved_symbol_get_inner ($5) == NULL) {
$$ = VALA_METHOD (vala_code_context_create_creation_method (context, vala_unresolved_symbol_get_name ($5), NULL, src)); } else {
$$ = VALA_METHOD (vala_code_context_create_creation_method (context, vala_unresolved_symbol_get_name (vala_unresolved_symbol_get_inner ($5)), vala_unresolved_symbol_get_name ($5), src));
}
g_object_unref ($5);
g_object_unref (src);
vala_method_set_instance ($$, FALSE);
if ($3 != -1) {
......@@ -3230,20 +3237,20 @@ method_header
}
VALA_CODE_NODE($$)->attributes = $2;
if ($8 != NULL) {
for (l = $8; l != NULL; l = l->next) {
if ($7 != NULL) {
for (l = $7; l != NULL; l = l->next) {
vala_method_add_parameter ($$, l->data);
g_object_unref (l->data);
}
g_list_free ($8);
g_list_free ($7);
}
for (l = $10; l != NULL; l = l->next) {
for (l = $9; l != NULL; l = l->next) {
vala_method_add_error_domain ($$, l->data);
g_object_unref (l->data);
}
if ($10 != NULL) {
g_list_free ($10);
if ($9 != NULL) {
g_list_free ($9);
}
}
;
......
......@@ -80,6 +80,7 @@
#include <vala/valatypeparameter.h>
#include <vala/valatypesymbol.h>
#include <vala/valaunaryexpression.h>
#include <vala/valaunresolvedsymbol.h>
#include <vala/valaunresolvedtype.h>
#include <vala/valavariabledeclarator.h>
#include <vala/valavoidtype.h>
......
......@@ -180,34 +180,13 @@ public class Vala.SymbolResolver : CodeVisitor {
}
}
private DataType! resolve_type (UnresolvedType! unresolved_type) {
var type = new DataType ();
type.source_reference = unresolved_type.source_reference;
type.takes_ownership = unresolved_type.takes_ownership;
type.transfers_ownership = unresolved_type.transfers_ownership;
type.is_ref = unresolved_type.is_ref;
type.is_out = unresolved_type.is_out;
type.nullable = unresolved_type.nullable;
type.requires_null_check = unresolved_type.requires_null_check;
foreach (DataType type_arg in unresolved_type.get_type_arguments ()) {
type.add_type_argument (type_arg);
}
// still required for vapigen
if (unresolved_type.type_name == "void") {
return new VoidType ();
}
if (unresolved_type.namespace_name == null) {
private Symbol? resolve_symbol (UnresolvedSymbol unresolved_symbol) {
if (unresolved_symbol.inner == null) {
Symbol sym = null;
Scope scope = current_scope;
while (sym == null && scope != null) {
sym = scope.lookup (unresolved_type.type_name);
sym = scope.lookup (unresolved_symbol.name);
scope = scope.parent_scope;
if (sym != null && !(sym is Typesymbol) && !(sym is TypeParameter)) {
// ignore non-type symbols
sym = null;
}
}
if (sym == null) {
foreach (NamespaceReference ns in current_using_directives) {
......@@ -215,55 +194,68 @@ public class Vala.SymbolResolver : CodeVisitor {
continue;
}
var local_sym = ns.namespace_symbol.scope.lookup (unresolved_type.type_name);
var local_sym = ns.namespace_symbol.scope.lookup (unresolved_symbol.name);
if (local_sym != null) {
if (sym != null) {
Report.error (type.source_reference, "`%s' is an ambiguous reference between `%s' and `%s'".printf (unresolved_type.type_name, sym.get_full_name (), local_sym.get_full_name ()));
return new InvalidType ();
unresolved_symbol.error = true;
Report.error (unresolved_symbol.source_reference, "`%s' is an ambiguous reference between `%s' and `%s'".printf (unresolved_symbol.name, sym.get_full_name (), local_sym.get_full_name ()));
return null;
}
sym = local_sym;
}
}
}
if (sym == null) {
Report.error (type.source_reference, "The type name `%s' could not be found".printf (unresolved_type.type_name));
return new InvalidType ();
}
if (sym is TypeParameter) {
type.type_parameter = (TypeParameter) sym;
} else if (sym is Typesymbol) {
if (sym is Delegate) {
type = new DelegateType ((Delegate) sym);
} else {
type.data_type = (Typesymbol) sym;
}
} else {
Report.error (type.source_reference, "`%s' is not a type".printf (sym.get_full_name ()));
return new InvalidType ();
}
return sym;
} else {
var ns_symbol = root_symbol.scope.lookup (unresolved_type.namespace_name);
if (ns_symbol == null) {
type.error = true;
Report.error (type.source_reference, "The namespace name `%s' could not be found".printf (unresolved_type.namespace_name));
return new InvalidType ();
var parent_symbol = resolve_symbol (unresolved_symbol.inner);
if (parent_symbol == null) {
unresolved_symbol.error = true;
Report.error (unresolved_symbol.inner.source_reference, "The symbol `%s' could not be found".printf (unresolved_symbol.inner.name));
return null;
}
var sym = ns_symbol.scope.lookup (unresolved_type.type_name);
if (sym == null) {
Report.error (type.source_reference, "The type name `%s' does not exist in the namespace `%s'".printf (unresolved_type.type_name, unresolved_type.namespace_name));
return new InvalidType ();
return parent_symbol.scope.lookup (unresolved_symbol.name);
}
}
private DataType! resolve_type (UnresolvedType! unresolved_type) {
var type = new DataType ();
type.source_reference = unresolved_type.source_reference;
type.takes_ownership = unresolved_type.takes_ownership;
type.transfers_ownership = unresolved_type.transfers_ownership;
type.is_ref = unresolved_type.is_ref;
type.is_out = unresolved_type.is_out;
type.nullable = unresolved_type.nullable;
type.requires_null_check = unresolved_type.requires_null_check;
foreach (DataType type_arg in unresolved_type.get_type_arguments ()) {
type.add_type_argument (type_arg);
}
// still required for vapigen
if (unresolved_type.unresolved_symbol.name == "void") {
return new VoidType ();
}
var sym = resolve_symbol (unresolved_type.unresolved_symbol);
if (sym == null) {
// don't report same error twice
if (!unresolved_type.unresolved_symbol.error) {
Report.error (type.source_reference, "The type name `%s' could not be found".printf (unresolved_type.unresolved_symbol.to_string ()));
}
if (sym is Typesymbol) {
if (sym is Delegate) {
type = new DelegateType ((Delegate) sym);
} else {
type.data_type = (Typesymbol) sym;
}
return new InvalidType ();
}
if (sym is TypeParameter) {
type.type_parameter = (TypeParameter) sym;
} else if (sym is Typesymbol) {
if (sym is Delegate) {
type = new DelegateType ((Delegate) sym);
} else {
Report.error (type.source_reference, "`%s' is not a type".printf (sym.get_full_name ()));
return new InvalidType ();
type.data_type = (Typesymbol) sym;
}
} else {
Report.error (type.source_reference, "`%s' is not a type".printf (sym.get_full_name ()));
return new InvalidType ();
}
for (int pointer_level = unresolved_type.pointer_level; pointer_level > 0; pointer_level--) {
......
/* valaunresolvedsymbol.vala
*
* Copyright (C) 2008 Jürg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Author:
* Jürg Billeter <j@bitron.ch>
*/
using GLib;
/**
* An unresolved reference to a symbol.
*/
public class Vala.UnresolvedSymbol : CodeNode {
/**
* The parent of the symbol or null.
*/
public UnresolvedSymbol? inner { get; set; }
/**
* The symbol name.
*/
public string name { get; set; }
public UnresolvedSymbol (UnresolvedSymbol? inner, string name, SourceReference? source_reference = null) {
this.inner = inner;
this.name = name;
this.source_reference = source_reference;
}
public override string to_string () {
if (inner == null) {
return name;
} else {
return "%s.%s".printf (inner.to_string (), name);
}
}
public UnresolvedSymbol copy () {
return new UnresolvedSymbol (inner, name, source_reference);
}
}
......@@ -29,15 +29,10 @@ using Gee;
*/
public class Vala.UnresolvedType : DataType {
/**
* The name of the namespace containing the referred data type.
* The unresolved reference to a type symbol.
*/
public string namespace_name { get; set; }
/**
* The name of the referred data type.
*/
public string type_name { get; set; }
public UnresolvedSymbol unresolved_symbol { get; set; }
/**
* Specifies the rank of the array this reference is possibly referring
* to. "0" indicates no array.
......@@ -61,14 +56,12 @@ public class Vala.UnresolvedType : DataType {
/**
* Creates a new type reference.
*
* @param ns optional namespace name
* @param type_name type symbol name
* @param symbol unresolved type symbol
* @param source reference to source code
* @return newly created type reference
*/
public UnresolvedType.from_name (string ns, string! type, SourceReference source = null) {
namespace_name = ns;
type_name = type;
public UnresolvedType.from_symbol (UnresolvedSymbol symbol, SourceReference source = null) {
this.unresolved_symbol = symbol;
source_reference = source;
}
......@@ -89,10 +82,10 @@ public class Vala.UnresolvedType : DataType {
if (ma.inner != null) {
if (ma.inner is MemberAccess) {
var simple = (MemberAccess) ma.inner;
type_ref = new UnresolvedType.from_name (simple.member_name, ma.member_name, ma.source_reference);
type_ref = new UnresolvedType.from_symbol (new UnresolvedSymbol (new UnresolvedSymbol (null, simple.member_name, ma.source_reference), ma.member_name, ma.source_reference), ma.source_reference);
}
} else {
type_ref = new UnresolvedType.from_name (null, ma.member_name, ma.source_reference);
type_ref = new UnresolvedType.from_symbol (new UnresolvedSymbol (null, ma.member_name, ma.source_reference), ma.source_reference);
}
if (type_ref != null) {
......@@ -117,8 +110,7 @@ public class Vala.UnresolvedType : DataType {
result.is_out = is_out;
result.nullable = nullable;
result.requires_null_check = requires_null_check;
result.namespace_name = namespace_name;
result.type_name = type_name;
result.unresolved_symbol = unresolved_symbol.copy ();
result.array_rank = array_rank;
result.pointer_level = pointer_level;
result.is_ref = is_ref;
......
......@@ -247,7 +247,7 @@ namespace Atk {
public uint state;
public uint keyval;
public int length;
public weak string string;
public weak string str;
public ushort keycode;
public uint timestamp;
}
......@@ -511,10 +511,10 @@ namespace Atk {
public abstract void copy_text (int start_pos, int end_pos);
public abstract void cut_text (int start_pos, int end_pos);
public abstract void delete_text (int start_pos, int end_pos);
public abstract void insert_text (string string, int length, int position);
public abstract void insert_text (string str, int length, int position);
public abstract void paste_text (int position);
public abstract bool set_run_attributes (Atk.AttributeSet attrib_set, int start_offset, int end_offset);
public abstract void set_text_contents (string string);
public abstract void set_text_contents (string str);
}
[CCode (cheader_filename = "atk/atk.h")]
public interface HyperlinkImpl {
......
......@@ -654,7 +654,7 @@ namespace Gdk {
public uint state;
public uint keyval;
public int length;
public weak string string;
public weak string str;
public ushort hardware_keycode;
public uchar group;
public uint is_modifier;
......
......@@ -1635,18 +1635,18 @@ namespace GLib {
[NoArrayLength ()]
public void set_seed_array (uint32[] seed, uint seed_length);
public bool boolean ();
public uint32 @int ();
public uint32 next_int ();
public int32 int_range (int32 begin, int32 end);
public double @double ();
public double next_double ();
public double double_range (double begin, double end);
}
public static class Random {
public static void set_seed (uint32 seed);
public static bool boolean ();
public static uint32 @int ();
public static uint32 next_int ();
public static int32 int_range (int32 begin, int32 end);
public static double @double ();
public static double next_double ();
public static double double_range (double begin, double end);
}
......@@ -2223,21 +2223,21 @@ namespace GLib {
public int get_max_backref ();
public int get_capture_count ();
public int get_string_number (string! name);
public string! escape_string (string! string, int length = -1);
public static bool match_simple (string! pattern, string! string, RegexCompileFlags compile_options = 0, RegexMatchFlags match_options = 0);
public bool match (string! string, RegexMatchFlags match_options = 0, out MatchInfo match_info = null);
public bool match_full (string! string, long string_len = -1, int start_position = 0, RegexMatchFlags match_options = 0, out MatchInfo match_info = null) throws RegexError;
public bool match_all (string! string, RegexMatchFlags match_options = 0, out MatchInfo match_info = null);
public bool match_all_full (string! string, long string_len = -1, int start_position = 0, RegexMatchFlags match_options = 0, out MatchInfo match_info = null) throws RegexError;
public string! escape_string (string! str, int length = -1);
public static bool match_simple (string! pattern, string! str, RegexCompileFlags compile_options = 0, RegexMatchFlags match_options = 0);
public bool match (string! str, RegexMatchFlags match_options = 0, out MatchInfo match_info = null);
public bool match_full (string! str, long string_len = -1, int start_position = 0, RegexMatchFlags match_options = 0, out MatchInfo match_info = null) throws RegexError;
public bool match_all (string! str, RegexMatchFlags match_options = 0, out MatchInfo match_info = null);
public bool match_all_full (string! str, long string_len = -1, int start_position = 0, RegexMatchFlags match_options = 0, out MatchInfo match_info = null) throws RegexError;
[NoArrayLength]
public static string[] split_simple (string! pattern, string! string, RegexCompileFlags compile_options = 0, RegexMatchFlags match_options = 0);
public static string[] split_simple (string! pattern, string! str, RegexCompileFlags compile_options = 0, RegexMatchFlags match_options = 0);
[NoArrayLength]
public string[] split (string! string, RegexMatchFlags match_options = 0);
public string[] split (string! str, RegexMatchFlags match_options = 0);
[NoArrayLength]
public bool split_full (string! string, long string_len = -1, int start_position = 0, RegexMatchFlags match_options = 0, int max_tokens = 0) throws RegexError;
public string replace (string! string, long string_len, int start_position, string! replacement, RegexMatchFlags match_options = 0) throws RegexError;
public string replace_literal (string! string, long string_len, int start_position, string! replacement, RegexMatchFlags match_options = 0) throws RegexError;
public string replace_eval (string! string, long string_len, int start_position, RegexMatchFlags match_options = 0, RegexEvalCallback eval, pointer user_data) throws RegexError;
public bool split_full (string! str, long string_len = -1, int start_position = 0, RegexMatchFlags match_options = 0, int max_tokens = 0) throws RegexError;
public string replace (string! str, long string_len, int start_position, string! replacement, RegexMatchFlags match_options = 0) throws RegexError;
public string replace_literal (string! str, long string_len, int start_position, string! replacement, RegexMatchFlags match_options = 0) throws RegexError;
public string replace_eval (string! str, long string_len, int start_position, RegexMatchFlags match_options = 0, RegexEvalCallback eval, pointer user_data) throws RegexError;
public static bool check_replacement (out bool has_references = null) throws RegexError;
}
......@@ -2355,8 +2355,8 @@ namespace GLib {
public double[] get_double_list (string! group_name, string! key) throws KeyFileError;
public string get_comment (string! group_name, string! key) throws KeyFileError;
public void set_value (string! group_name, string! key, string! value);
public void set_string (string! group_name, string! key, string! string);
public void set_locale_string (string! group_name, string! key, string! locale, string! string);
public void set_string (string! group_name, string! key, string! str);
public void set_locale_string (string! group_name, string! key, string! locale, string! str);
public void set_boolean (string! group_name, string! key, bool value);
public void set_integer (string! group_name, string! key, int value);
public void set_double (string! group_name, string! key, double value);
......@@ -2796,7 +2796,7 @@ namespace GLib {
/* Quarks */
public struct Quark : uint32 {
public static Quark from_string (string string);
public static Quark from_string (string str);
public weak string to_string ();
}
......
......@@ -76,7 +76,7 @@ namespace Gnome {
public DesktopItem ();
public DesktopItem.from_basename (string basename, Gnome.DesktopItemLoadFlags flags) throws GLib.Error;
public DesktopItem.from_file (string file, Gnome.DesktopItemLoadFlags flags) throws GLib.Error;
public DesktopItem.from_string (string uri, string string, long length, Gnome.DesktopItemLoadFlags flags) throws GLib.Error;
public DesktopItem.from_string (string uri, string str, long length, Gnome.DesktopItemLoadFlags flags) throws GLib.Error;
public DesktopItem.from_uri (string uri, Gnome.DesktopItemLoadFlags flags) throws GLib.Error;
public bool save (string under, bool force) throws GLib.Error;
public void set_boolean (string attr, bool value);
......
......@@ -1058,11 +1058,11 @@ namespace GnomeVFS {
[CCode (cheader_filename = "libgnomevfs/gnome-vfs.h")]
public static weak string escape_path_string (string path);
[CCode (cheader_filename = "libgnomevfs/gnome-vfs.h")]
public static weak string escape_set (string string, string match_set);
public static weak string escape_set (string str, string match_set);
[CCode (cheader_filename = "libgnomevfs/gnome-vfs.h")]
public static weak string escape_slashes (string string);
public static weak string escape_slashes (string str);
[CCode (cheader_filename = "libgnomevfs/gnome-vfs.h")]
public static weak string escape_string (string string);
public static weak string escape_string (string str);
[CCode (cheader_filename = "libgnomevfs/gnome-vfs.h")]
public static weak string expand_initial_tilde (string path);
[CCode (cheader_filename = "libgnomevfs/gnome-vfs.h")]
......
......@@ -825,7 +825,7 @@ namespace Gst {
[CCode (cheader_filename = "gst/gst.h")]
public class StaticCaps {
public weak Gst.Caps caps;
public weak string string;
public weak string str;
[NoArrayLength]
public weak pointer[] _gst_reserved;
public weak Gst.Caps get ();
......@@ -946,7 +946,7 @@ namespace Gst {
public weak Gst.Caps copy ();
public weak Gst.Caps copy_nth (uint nth);
public bool do_simplify ();
public static weak Gst.Caps from_string (string string);
public static weak Gst.Caps from_string (string str);
public uint get_size ();
public weak Gst.Structure get_structure (uint index);
public weak Gst.Caps intersect (Gst.Caps caps2);
......@@ -1031,7 +1031,7 @@ namespace Gst {
public bool fixate_field_nearest_fraction (string field_name, int target_numerator, int target_denominator);
public bool fixate_field_nearest_int (string field_name, int target);
public bool @foreach (Gst.StructureForeachFunc func);
public static weak Gst.Structure from_string (string string, string end);
public static weak Gst.Structure from_string (string str, string end);
public bool get_boolean (string fieldname, out bool value);
public bool get_clock_time (string fieldname, Gst.ClockTime value);
public bool get_date (string fieldname, out weak GLib.Date value);
......
......@@ -1728,7 +1728,7 @@ namespace Gtk {
public ushort accel_string_width;
public weak Gtk.Widget get_accel_widget ();
public uint get_accel_width ();
public AccelLabel (string string);
public AccelLabel (string str);
public bool refetch ();
public void set_accel_closure (GLib.Closure accel_closure);
public void set_accel_widget (Gtk.Widget accel_widget);
......@@ -1833,7 +1833,7 @@ namespace Gtk {
public void set_translate_func (Gtk.TranslateFunc func, pointer data, Gtk.DestroyNotify notify);
public void set_translation_domain (string domain);
public void set_visible (bool visible);
public weak string translate_string (string string);
public weak string translate_string (string str);
public virtual weak Gtk.Action get_action (string action_name);
[NoAccessorMethod]
public weak string name { get; construct; }
......@@ -1978,8 +1978,8 @@ namespace Gtk {
public weak string get_translation_domain ();
public Builder ();
public void set_translation_domain (string domain);
public bool value_from_string (GLib.ParamSpec pspec, string string, GLib.Value value) throws GLib.Error;
public bool value_from_string_type (GLib.Type type, string string, GLib.Value value) throws GLib.Error;
public bool value_from_string (GLib.ParamSpec pspec, string str, GLib.Value value) throws GLib.Error;
public bool value_from_string_type (GLib.Type type, string str, GLib.Value value) throws GLib.Error;
public virtual GLib.Type get_type_from_name (string type_name);
public weak string translation_domain { get; set; }
}
......@@ -4637,7 +4637,7 @@ namespace Gtk {
[NoWrapper]
public virtual void draw_slider (Gdk.Window window, Gtk.StateType state_type, Gtk.ShadowType shadow_type, Gdk.Rectangle area, Gtk.Widget widget, string detail, int x, int y, int width, int height, Gtk.Orientation orientation);
[NoWrapper]
public virtual void draw_string (Gdk.Window window, Gtk.StateType state_type, Gdk.Rectangle area, Gtk.Widget widget, string detail, int x, int y, string string);
public virtual void draw_string (Gdk.Window window, Gtk.StateType state_type, Gdk.Rectangle area, Gtk.Widget widget, string detail, int x, int y, string str);
[NoWrapper]
public virtual void draw_tab (Gdk.Window window, Gtk.StateType state_type, Gtk.ShadowType shadow_type, Gdk.Rectangle area, Gtk.Widget widget, string detail, int x, int y, int width, int height);
[NoWrapper]
......
......@@ -84,7 +84,7 @@ namespace Glade {
public void set_common_params (Gtk.Widget widget, Glade.WidgetInfo info);
public void set_packing_property (Gtk.Widget parent, Gtk.Widget child, string name, string value);
public void set_toplevel (Gtk.Window window);
public bool set_value_from_string (GLib.ParamSpec pspec, string string, GLib.Value value);
public bool set_value_from_string (GLib.ParamSpec pspec, string str, GLib.Value value);
public void signal_autoconnect ();
public void signal_autoconnect_full (Glade.XMLConnectFunc func);
public void signal_connect (string handlername, GLib.Callback func);
......@@ -101,9 +101,9 @@ namespace Glade {
public delegate weak Gtk.Widget XMLCustomWidgetHandler (Glade.XML xml, string func_name, string name, string string1, string string2, int int1, int int2);
public const int MODULE_API_VERSION;
[CCode (cheader_filename = "glade/glade.h")]
public static int enum_from_string (GLib.Type type, string string);
public static int enum_from_string (GLib.Type type, string str);
[CCode (cheader_filename = "glade/glade.h")]
public static uint flags_from_string (GLib.Type type, string string);
public static uint flags_from_string (GLib.Type type, string str);
[CCode (cheader_filename = "glade/glade.h")]
public static weak string get_widget_name (Gtk.Widget widget);
[CCode (cheader_filename = "glade/glade.h")]
......
......@@ -223,7 +223,7 @@ namespace Gnome {
public static void fill_toolbar_custom (Gtk.Toolbar toolbar, Gnome.UIInfo uiinfo, Gnome.UIBuilderData uibdata, Gtk.AccelGroup accel_group);
public static void fill_toolbar_with_data (Gtk.Toolbar toolbar, Gnome.UIInfo uiinfo, Gtk.AccelGroup accel_group);
public static weak Gtk.Widget find_menu_pos (Gtk.Widget parent, string path, int pos);
public static weak string helper_gettext (string string);
public static weak string helper_gettext (string str);
public void insert_menus (string path, Gnome.UIInfo menuinfo);
public void insert_menus_custom (string path, Gnome.UIInfo uiinfo, Gnome.UIBuilderData uibdata);
public void insert_menus_interp (string path, Gnome.UIInfo menuinfo, Gtk.CallbackMarshal relay_func, pointer data, Gtk.DestroyNotify destroy_func);
......@@ -485,7 +485,7 @@ namespace Gnome {
public static delegate void InteractFunction (Gnome.Client client, int key, Gnome.DialogType dialog_type, pointer data);
public delegate double PasswordDialogQualityFunc (Gnome.PasswordDialog password_dialog, string password);
public static delegate void ReplyCallback (int reply, pointer data);
public static delegate void StringCallback (string string, pointer data);
public static delegate void StringCallback (string str, pointer data);
public static delegate void UISignalConnectFunc (Gnome.UIInfo uiinfo, string signal_name, Gnome.UIBuilderData uibdata);
public const string GNOMEUIINFO_KEY_UIBDATA;
public const string GNOMEUIINFO_KEY_UIDATA;
......
......@@ -258,8 +258,8 @@ GtkWidget.window weak="0"
GtkWidget::child_notify has_emitter="1"
GtkWidget::grab_focus has_emitter="1"
GtkWidget::hide has_emitter="1"
GtkWidget::key_press_event.event type_name="EventKey"
GtkWidget::key_release_event.event type_name="EventKey"
GtkWidget::key_press_event.event namespace_name="Gdk" type_name="EventKey"
GtkWidget::key_release_event.event namespace_name="Gdk" type_name="EventKey"
GtkWidget::keynav_failed has_emitter="1"
GtkWidget::map has_emitter="1"
GtkWidget::mnemonic_activate has_emitter="1"
......
......@@ -135,11 +135,11 @@ namespace WebKit {
public bool has_selection ();
public void load_html_string (string content, string base_uri);
public void load_string (string content, string content_mime_type, string content_encoding, string base_uri);
public uint mark_text_matches (string string, bool case_sensitive, uint limit);
public uint mark_text_matches (string str, bool case_sensitive, uint limit);
public WebView ();
public void open (string uri);
public void reload ();
public bool search_text (string string, bool case_sensitive, bool forward, bool wrap);
public bool search_text (string str, bool case_sensitive, bool forward, bool wrap);
public void set_editable (bool flag);
public void set_highlight_text_matches (bool highlight);
public void set_maintains_back_forward_list (bool flag);
......
......@@ -301,7 +301,13 @@ public class Vala.GIdlParser : CodeVisitor {
// hide user_data parameter for instance delegates
cb.instance = true;
} else {
var p = new FormalParameter (param_node.name, parse_param (param));
string param_name = param_node.name;
if (param_name == "string") {
// avoid conflict with string type
param_name = "str";
}
var p = new FormalParameter (param_name, parse_param (param));
cb.add_parameter (p);
}
}
......@@ -644,10 +650,8 @@ public class Vala.GIdlParser : CodeVisitor {
current_source_file.add_node (cl);
}
var parent = new UnresolvedType ();
parent.namespace_name = "GLib";
parent.type_name = "Boxed";
cl.add_base_type (parent);
var gboxed_symbol = new UnresolvedSymbol (new UnresolvedSymbol (null, "GLib"), "Boxed");
cl.add_base_type (new UnresolvedType.from_symbol (gboxed_symbol));
current_data_type = cl;
......@@ -791,10 +795,8 @@ public class Vala.GIdlParser : CodeVisitor {
parse_type_string (parent, node.parent);
cl.add_base_type (parent);
} else {
var parent = new UnresolvedType ();
parent.namespace_name = "GLib";
parent.type_name = "Object";
cl.add_base_type (parent);
var gobject_symbol = new UnresolvedSymbol (new UnresolvedSymbol (null, "GLib"), "Object");
cl.add_base_type (new UnresolvedType.from_symbol (gobject_symbol));
}
foreach (string iface_name in node.interfaces) {
......@@ -950,63 +952,59 @@ public class Vala.GIdlParser : CodeVisitor {
var type = new UnresolvedType ();
if (type_node.tag == TypeTag.VOID) {
if (type_node.is_pointer) {
type.type_name = "pointer";
type.unresolved_symbol = new UnresolvedSymbol (null, "pointer");
} else {
type.type_name = "void";
type.unresolved_symbol = new UnresolvedSymbol (null, "void");
}
} else if (type_node.tag == TypeTag.BOOLEAN) {
type.type_name = "bool";
type.unresolved_symbol = new UnresolvedSymbol (null, "bool");
} else if (type_node.tag == TypeTag.INT8) {
type.type_name = "char";
type.unresolved_symbol