vala r836 - in trunk: . gobject vala vapigen
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r836 - in trunk: . gobject vala vapigen
- Date: Sat, 12 Jan 2008 14:26:57 +0000 (GMT)
Author: juergbi
Date: Sat Jan 12 14:26:48 2008
New Revision: 836
URL: http://svn.gnome.org/viewvc/vala?rev=836&view=rev
Log:
2008-01-12 Juerg Billeter <j bitron ch>
* vala/Makefile.am, vala/parser.y, vala/vala.h,
vala/valaattributeprocessor.vala, vala/valacodecontext.vala,
vala/valacodegenerator.vala, vala/valacodevisitor.vala,
vala/valadatatype.vala, vala/valadelegate.vala,
vala/valadelegatetype.vala, vala/valainterfacewriter.vala,
vala/valanamespace.vala, vala/valanulltype.vala,
vala/valasemanticanalyzer.vala, vala/valasignal.vala,
vala/valasymbolresolver.vala, gobject/valaccodegenerator.vala,
gobject/valaccodegeneratorinvocationexpression.vala,
vapigen/valagidlparser.vala: rename Callback to Delegate
Added:
trunk/vala/valadelegate.vala
- copied, changed from r809, /trunk/vala/valacallback.vala
Removed:
trunk/vala/valacallback.vala
Modified:
trunk/ChangeLog
trunk/gobject/valaccodegenerator.vala
trunk/gobject/valaccodegeneratorinvocationexpression.vala
trunk/vala/Makefile.am
trunk/vala/parser.y
trunk/vala/vala.h
trunk/vala/valaattributeprocessor.vala
trunk/vala/valacodecontext.vala
trunk/vala/valacodegenerator.vala
trunk/vala/valacodevisitor.vala
trunk/vala/valadatatype.vala
trunk/vala/valadelegatetype.vala
trunk/vala/valainterfacewriter.vala
trunk/vala/valanamespace.vala
trunk/vala/valanulltype.vala
trunk/vala/valasemanticanalyzer.vala
trunk/vala/valasignal.vala
trunk/vala/valasymbolresolver.vala
trunk/vapigen/valagidlparser.vala
Modified: trunk/gobject/valaccodegenerator.vala
==============================================================================
--- trunk/gobject/valaccodegenerator.vala (original)
+++ trunk/gobject/valaccodegenerator.vala Sat Jan 12 14:26:48 2008
@@ -298,7 +298,7 @@
}
}
- public override void visit_callback (Callback! cb) {
+ public override void visit_delegate (Delegate! cb) {
cb.accept_children (this);
var cfundecl = new CCodeFunctionDeclarator (cb.get_cname ());
@@ -2825,7 +2825,7 @@
return null;
}
- public override CodeBinding create_callback_binding (Callback! node) {
+ public override CodeBinding create_delegate_binding (Delegate! node) {
return null;
}
Modified: trunk/gobject/valaccodegeneratorinvocationexpression.vala
==============================================================================
--- trunk/gobject/valaccodegeneratorinvocationexpression.vala (original)
+++ trunk/gobject/valaccodegeneratorinvocationexpression.vala Sat Jan 12 14:26:48 2008
@@ -225,7 +225,7 @@
var param = params_it.get ();
ellipsis = param.ellipsis;
if (!ellipsis) {
- if (param.type_reference.data_type is Callback) {
+ if (param.type_reference.data_type is Delegate) {
cexpr = new CCodeCastExpression (cexpr, param.type_reference.data_type.get_cname ());
} else {
if (!param.no_array_length && param.type_reference.data_type is Array) {
Modified: trunk/vala/Makefile.am
==============================================================================
--- trunk/vala/Makefile.am (original)
+++ trunk/vala/Makefile.am Sat Jan 12 14:26:48 2008
@@ -29,7 +29,6 @@
valablock.vala \
valabooleanliteral.vala \
valabreakstatement.vala \
- valacallback.vala \
valacastexpression.vala \
valacatchclause.vala \
valacharacterliteral.vala \
@@ -47,6 +46,7 @@
valacreationmethod.vala \
valadatatype.vala \
valadeclarationstatement.vala \
+ valadelegate.vala \
valadelegatetype.vala \
valadestructor.vala \
valadostatement.vala \
Modified: trunk/vala/parser.y
==============================================================================
--- trunk/vala/parser.y (original)
+++ trunk/vala/parser.y Sat Jan 12 14:26:48 2008
@@ -2519,7 +2519,7 @@
| struct_declaration
| interface_declaration
| enum_declaration
- | callback_declaration
+ | delegate_declaration
| constant_declaration
{
/* skip declarations with errors */
@@ -3751,7 +3751,7 @@
}
;
-callback_declaration
+delegate_declaration
: comment opt_attributes opt_access_modifier opt_modifiers DELEGATE type identifier opt_name_specifier opt_type_parameter_list OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS opt_throws_declaration SEMICOLON
{
ValaSourceReference *src;
@@ -3784,12 +3784,12 @@
}
src = src_com(@7, $1);
- ValaCallback *cb = vala_code_context_create_callback (context, name, $6, src);
+ ValaDelegate *cb = vala_code_context_create_delegate (context, name, $6, src);
g_free (name);
g_object_unref ($6);
g_object_unref (src);
- vala_namespace_add_callback (VALA_NAMESPACE (parent_symbol), cb);
+ vala_namespace_add_delegate (VALA_NAMESPACE (parent_symbol), cb);
vala_source_file_add_node (current_source_file, VALA_CODE_NODE (cb));
g_object_unref (parent_symbol);
@@ -3800,14 +3800,14 @@
if ($9 != NULL) {
for (l = $9; l != NULL; l = l->next) {
- vala_callback_add_type_parameter (cb, l->data);
+ vala_delegate_add_type_parameter (cb, l->data);
g_object_unref (l->data);
}
g_list_free ($9);
}
if ($11 != NULL) {
for (l = $11; l != NULL; l = l->next) {
- vala_callback_add_parameter (cb, l->data);
+ vala_delegate_add_parameter (cb, l->data);
g_object_unref (l->data);
}
g_list_free ($11);
Modified: trunk/vala/vala.h
==============================================================================
--- trunk/vala/vala.h (original)
+++ trunk/vala/vala.h Sat Jan 12 14:26:48 2008
@@ -7,7 +7,6 @@
#include <vala/valablock.h>
#include <vala/valabooleanliteral.h>
#include <vala/valabreakstatement.h>
-#include <vala/valacallback.h>
#include <vala/valacastexpression.h>
#include <vala/valacatchclause.h>
#include <vala/valacharacterliteral.h>
@@ -20,6 +19,7 @@
#include <vala/valacreationmethod.h>
#include <vala/valadatatype.h>
#include <vala/valadeclarationstatement.h>
+#include <vala/valadelegate.h>
#include <vala/valadestructor.h>
#include <vala/valadostatement.h>
#include <vala/valaelementaccess.h>
Modified: trunk/vala/valaattributeprocessor.vala
==============================================================================
--- trunk/vala/valaattributeprocessor.vala (original)
+++ trunk/vala/valaattributeprocessor.vala Sat Jan 12 14:26:48 2008
@@ -1,6 +1,6 @@
/* valaattributeprocessor.vala
*
- * Copyright (C) 2006-2007 JÃrg Billeter, Raffaele Sandrini
+ * Copyright (C) 2006-2008 JÃrg Billeter, Raffaele Sandrini
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -82,8 +82,8 @@
prop.process_attributes ();
}
- public override void visit_callback (Callback! cb) {
- cb.process_attributes ();
+ public override void visit_delegate (Delegate! d) {
+ d.process_attributes ();
}
public override void visit_constant (Constant! c) {
Modified: trunk/vala/valacodecontext.vala
==============================================================================
--- trunk/vala/valacodecontext.vala (original)
+++ trunk/vala/valacodecontext.vala Sat Jan 12 14:26:48 2008
@@ -407,9 +407,9 @@
return node;
}
- public Callback! create_callback (string name, DataType return_type, SourceReference source_reference = null) {
- var node = new Callback (name, return_type, source_reference);
- node.code_binding = codegen.create_callback_binding (node);
+ public Delegate! create_delegate (string name, DataType return_type, SourceReference source_reference = null) {
+ var node = new Delegate (name, return_type, source_reference);
+ node.code_binding = codegen.create_delegate_binding (node);
return node;
}
Modified: trunk/vala/valacodegenerator.vala
==============================================================================
--- trunk/vala/valacodegenerator.vala (original)
+++ trunk/vala/valacodegenerator.vala Sat Jan 12 14:26:48 2008
@@ -1,6 +1,6 @@
/* valacodegenerator.vala
*
- * Copyright (C) 2007 JÃrg Billeter
+ * Copyright (C) 2007-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
@@ -58,7 +58,7 @@
return null;
}
- public virtual CodeBinding create_callback_binding (Callback! node) {
+ public virtual CodeBinding create_delegate_binding (Delegate! node) {
return null;
}
Modified: trunk/vala/valacodevisitor.vala
==============================================================================
--- trunk/vala/valacodevisitor.vala (original)
+++ trunk/vala/valacodevisitor.vala Sat Jan 12 14:26:48 2008
@@ -1,6 +1,6 @@
/* valacodevisitor.vala
*
- * Copyright (C) 2006-2007 JÃrg Billeter, Raffaele Sandrini
+ * Copyright (C) 2006-2008 JÃrg Billeter, Raffaele Sandrini
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -84,11 +84,11 @@
}
/**
- * Visit operation called for callbacks.
+ * Visit operation called for delegates.
*
- * @param cb a callback
+ * @param d a delegate
*/
- public virtual void visit_callback (Callback! cb) {
+ public virtual void visit_delegate (Delegate! d) {
}
/**
Modified: trunk/vala/valadatatype.vala
==============================================================================
--- trunk/vala/valadatatype.vala (original)
+++ trunk/vala/valadatatype.vala Sat Jan 12 14:26:48 2008
@@ -347,7 +347,7 @@
(data_type != null && (
data_type.is_reference_type () ||
data_type is Array ||
- data_type is Callback ||
+ data_type is Delegate ||
data_type.get_attribute ("PointerType") != null))) {
return true;
}
Copied: trunk/vala/valadelegate.vala (from r809, /trunk/vala/valacallback.vala)
==============================================================================
--- /trunk/vala/valacallback.vala (original)
+++ trunk/vala/valadelegate.vala Sat Jan 12 14:26:48 2008
@@ -1,6 +1,6 @@
-/* valacallback.vala
+/* valadelegate.vala
*
- * Copyright (C) 2006-2007 JÃrg Billeter
+ * Copyright (C) 2006-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
@@ -26,7 +26,7 @@
/**
* Represents a function callback type.
*/
-public class Vala.Callback : Typesymbol {
+public class Vala.Delegate : Typesymbol {
/**
* The return type of this callback.
*/
@@ -53,14 +53,14 @@
private DataType _return_type;
/**
- * Creates a new callback.
+ * Creates a new delegate.
*
- * @param name callback type name
+ * @param name delegate type name
* @param return_type return type
* @param source reference to source code
- * @return newly created callback
+ * @return newly created delegate
*/
- public Callback (construct string name, construct DataType return_type, construct SourceReference source_reference = null) {
+ public Delegate (construct string name, construct DataType return_type, construct SourceReference source_reference = null) {
}
/**
@@ -138,7 +138,7 @@
}
public override void accept (CodeVisitor! visitor) {
- visitor.visit_callback (this);
+ visitor.visit_delegate (this);
}
public override void accept_children (CodeVisitor! visitor) {
Modified: trunk/vala/valadelegatetype.vala
==============================================================================
--- trunk/vala/valadelegatetype.vala (original)
+++ trunk/vala/valadelegatetype.vala Sat Jan 12 14:26:48 2008
@@ -1,6 +1,6 @@
/* valadelegatetype.vala
*
- * Copyright (C) 2007 JÃrg Billeter
+ * Copyright (C) 2007-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
@@ -27,9 +27,9 @@
* The type of an instance of a delegate.
*/
public class Vala.DelegateType : DataType {
- public Callback delegate_symbol { get; set; }
+ public Delegate delegate_symbol { get; set; }
- public DelegateType (construct Callback delegate_symbol) {
+ public DelegateType (construct Delegate delegate_symbol) {
}
public override bool is_invokable () {
Modified: trunk/vala/valainterfacewriter.vala
==============================================================================
--- trunk/vala/valainterfacewriter.vala (original)
+++ trunk/vala/valainterfacewriter.vala Sat Jan 12 14:26:48 2008
@@ -450,7 +450,7 @@
write_string (")");
}
- public override void visit_callback (Callback! cb) {
+ public override void visit_delegate (Delegate! cb) {
if (cb.source_reference != null && cb.source_reference.file.pkg) {
return;
}
Modified: trunk/vala/valanamespace.vala
==============================================================================
--- trunk/vala/valanamespace.vala (original)
+++ trunk/vala/valanamespace.vala Sat Jan 12 14:26:48 2008
@@ -1,6 +1,6 @@
/* valanamespace.vala
*
- * Copyright (C) 2006-2007 JÃrg Billeter
+ * Copyright (C) 2006-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
@@ -36,7 +36,7 @@
private Gee.List<Interface> interfaces = new ArrayList<Interface> ();
private Gee.List<Struct> structs = new ArrayList<Struct> ();
private Gee.List<Enum> enums = new ArrayList<Enum> ();
- private Gee.List<Callback> callbacks = new ArrayList<Callback> ();
+ private Gee.List<Delegate> delegates = new ArrayList<Delegate> ();
private Gee.List<Constant> constants = new ArrayList<Constant> ();
private Gee.List<Field> fields = new ArrayList<Field> ();
private Gee.List<Method> methods = new ArrayList<Method> ();
@@ -119,13 +119,13 @@
}
/**
- * Adds the specified callback to this namespace.
+ * Adds the specified delegate to this namespace.
*
- * @param cb a callback
+ * @param d a delegate
*/
- public void add_callback (Callback! cb) {
- callbacks.add (cb);
- scope.add (cb.name, cb);
+ public void add_delegate (Delegate! d) {
+ delegates.add (d);
+ scope.add (d.name, d);
}
/**
@@ -224,8 +224,8 @@
st.accept (visitor);
}
- foreach (Callback cb in callbacks) {
- cb.accept (visitor);
+ foreach (Delegate d in delegates) {
+ d.accept (visitor);
}
foreach (Constant c in constants) {
Modified: trunk/vala/valanulltype.vala
==============================================================================
--- trunk/vala/valanulltype.vala (original)
+++ trunk/vala/valanulltype.vala Sat Jan 12 14:26:48 2008
@@ -45,7 +45,7 @@
if (target_type.data_type.is_reference_type () ||
target_type.data_type is Array ||
- target_type.data_type is Callback) {
+ target_type.data_type is Delegate) {
return !(CodeContext.is_non_null_enabled ());
}
Modified: trunk/vala/valasemanticanalyzer.vala
==============================================================================
--- trunk/vala/valasemanticanalyzer.vala (original)
+++ trunk/vala/valasemanticanalyzer.vala Sat Jan 12 14:26:48 2008
@@ -290,8 +290,8 @@
current_symbol = current_symbol.parent_symbol;
}
- public override void visit_callback (Callback! cb) {
- cb.accept_children (this);
+ public override void visit_delegate (Delegate! d) {
+ d.accept_children (this);
}
public override void visit_constant (Constant! c) {
@@ -682,9 +682,9 @@
}
if (decl.initializer.symbol_reference is Method &&
- decl.type_reference.data_type is Callback) {
+ decl.type_reference.data_type is Delegate) {
var m = (Method) decl.initializer.symbol_reference;
- var cb = (Callback) decl.type_reference.data_type;
+ var cb = (Delegate) decl.type_reference.data_type;
/* check whether method matches callback type */
if (!cb.matches_method (m)) {
@@ -2397,7 +2397,7 @@
break;
}
}
- } else if (type.data_type is Callback) {
+ } else if (type.data_type is Delegate) {
if (!callback_found) {
callback_found = true;
if (class_or_iface_found || type_param_found || ref_struct_found || val_struct_found || enum_found) {
@@ -2498,7 +2498,7 @@
in_instance_method = is_in_constructor ();
}
- var cb = (Callback) ((DelegateType) l.expected_type).delegate_symbol;
+ var cb = (Delegate) ((DelegateType) l.expected_type).delegate_symbol;
l.method = new Method (get_lambda_name (), cb.return_type);
l.method.instance = cb.instance && in_instance_method;
l.method.owner = current_symbol.scope;
@@ -2579,7 +2579,7 @@
if (ma.symbol_reference is Signal) {
var sig = (Signal) ma.symbol_reference;
- a.right.expected_type = new DelegateType (sig.get_callback ());
+ a.right.expected_type = new DelegateType (sig.get_delegate ());
} else {
a.right.expected_type = ma.static_type;
}
@@ -2685,9 +2685,9 @@
var decl = (VariableDeclarator) ma.symbol_reference;
if (a.right.symbol_reference is Method &&
- decl.type_reference.data_type is Callback) {
+ decl.type_reference.data_type is Delegate) {
var m = (Method) a.right.symbol_reference;
- var cb = (Callback) decl.type_reference.data_type;
+ var cb = (Delegate) decl.type_reference.data_type;
/* check whether method matches callback type */
if (!cb.matches_method (m)) {
@@ -2706,9 +2706,9 @@
var f = (Field) ma.symbol_reference;
if (a.right.symbol_reference is Method &&
- f.type_reference.data_type is Callback) {
+ f.type_reference.data_type is Delegate) {
var m = (Method) a.right.symbol_reference;
- var cb = (Callback) f.type_reference.data_type;
+ var cb = (Delegate) f.type_reference.data_type;
/* check whether method matches callback type */
if (!cb.matches_method (m)) {
Modified: trunk/vala/valasignal.vala
==============================================================================
--- trunk/vala/valasignal.vala (original)
+++ trunk/vala/valasignal.vala Sat Jan 12 14:26:48 2008
@@ -1,6 +1,6 @@
/* valasignal.vala
*
- * Copyright (C) 2006-2007 JÃrg Billeter
+ * Copyright (C) 2006-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
@@ -44,7 +44,7 @@
public bool has_emitter { get; set; }
private Gee.List<FormalParameter> parameters = new ArrayList<FormalParameter> ();
- private Callback generated_callback;
+ private Delegate generated_delegate;
private string cname;
@@ -78,14 +78,14 @@
}
/**
- * Returns generated callback to be used for signal handlers.
+ * Returns generated delegate to be used for signal handlers.
*
- * @return callback
+ * @return delegate
*/
- public Callback! get_callback () {
- if (generated_callback == null) {
- generated_callback = new Callback (null, return_type);
- generated_callback.instance = true;
+ public Delegate! get_delegate () {
+ if (generated_delegate == null) {
+ generated_delegate = new Delegate (null, return_type);
+ generated_delegate.instance = true;
ReferenceType sender_type;
if (parent_symbol is Class) {
@@ -94,14 +94,14 @@
sender_type = new InterfaceType ((Interface) parent_symbol);
}
var sender_param = new FormalParameter ("sender", sender_type);
- generated_callback.add_parameter (sender_param);
+ generated_delegate.add_parameter (sender_param);
foreach (FormalParameter! param in parameters) {
- generated_callback.add_parameter (param);
+ generated_delegate.add_parameter (param);
}
}
- return generated_callback;
+ return generated_delegate;
}
/**
Modified: trunk/vala/valasymbolresolver.vala
==============================================================================
--- trunk/vala/valasymbolresolver.vala (original)
+++ trunk/vala/valasymbolresolver.vala Sat Jan 12 14:26:48 2008
@@ -109,7 +109,7 @@
current_scope = current_scope.parent_scope;
}
- public override void visit_callback (Callback! cb) {
+ public override void visit_delegate (Delegate! cb) {
current_scope = cb.scope;
cb.accept_children (this);
@@ -231,8 +231,8 @@
if (sym is TypeParameter) {
type.type_parameter = (TypeParameter) sym;
} else if (sym is Typesymbol) {
- if (sym is Callback) {
- type = new DelegateType ((Callback) sym);
+ if (sym is Delegate) {
+ type = new DelegateType ((Delegate) sym);
} else {
type.data_type = (Typesymbol) sym;
}
@@ -254,8 +254,8 @@
return new InvalidType ();
}
if (sym is Typesymbol) {
- if (sym is Callback) {
- type = new DelegateType ((Callback) sym);
+ if (sym is Delegate) {
+ type = new DelegateType ((Delegate) sym);
} else {
type.data_type = (Typesymbol) sym;
}
Modified: trunk/vapigen/valagidlparser.vala
==============================================================================
--- trunk/vapigen/valagidlparser.vala (original)
+++ trunk/vapigen/valagidlparser.vala Sat Jan 12 14:26:48 2008
@@ -77,8 +77,8 @@
visit_type (en);
}
- public override void visit_callback (Callback! cb) {
- visit_type (cb);
+ public override void visit_delegate (Delegate! d) {
+ visit_type (d);
}
private void visit_type (Typesymbol! t) {
@@ -219,12 +219,12 @@
foreach (weak IdlNode node in module.entries) {
if (node.type == IdlNodeTypeId.CALLBACK) {
- var cb = parse_callback ((IdlNodeFunction) node);
+ var cb = parse_delegate ((IdlNodeFunction) node);
if (cb == null) {
continue;
}
cb.name = fix_type_name (cb.name, ns);
- ns.add_callback (cb);
+ ns.add_delegate (cb);
current_source_file.add_node (cb);
} else if (node.type == IdlNodeTypeId.STRUCT) {
parse_struct ((IdlNodeStruct) node, ns, module);
@@ -270,7 +270,7 @@
return ns;
}
- private Callback parse_callback (IdlNodeFunction! f_node) {
+ private Delegate parse_delegate (IdlNodeFunction! f_node) {
weak IdlNode node = (IdlNode) f_node;
var attributes = get_attributes (node.name);
@@ -285,7 +285,7 @@
}
}
- var cb = new Callback (node.name, parse_param (f_node.result), current_source_reference);
+ var cb = new Delegate (node.name, parse_param (f_node.result), current_source_reference);
cb.access = SymbolAccessibility.PUBLIC;
foreach (weak IdlNodeParam param in f_node.parameters) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]