Commit 5c4bcf9a authored by Jürg Billeter's avatar Jürg Billeter

Do not use Gee namespace to avoid conflict with libgee

parent 04a8e745
......@@ -21,7 +21,6 @@
*/
using GLib;
using Gee;
/**
* Represents a C code block.
......@@ -33,7 +32,7 @@ public class Vala.CCodeBlock : CCodeStatement {
*/
public bool suppress_newline { get; set; }
private Gee.List<CCodeNode> statements = new ArrayList<CCodeNode> ();
private List<CCodeNode> statements = new ArrayList<CCodeNode> ();
/**
* Prepend the specified statement to the list of statements.
......
......@@ -21,7 +21,6 @@
*/
using GLib;
using Gee;
/**
* Represents a case block in a switch statement in C code.
......
......@@ -21,13 +21,12 @@
*/
using GLib;
using Gee;
/**
* Represents a comma separated expression list in the C code.
*/
public class Vala.CCodeCommaExpression : CCodeExpression {
private Gee.List<CCodeExpression> inner = new ArrayList<CCodeExpression> ();
private List<CCodeExpression> inner = new ArrayList<CCodeExpression> ();
/**
* Appends the specified expression to the expression list.
......@@ -38,7 +37,7 @@ public class Vala.CCodeCommaExpression : CCodeExpression {
inner.add (expr);
}
public Gee.List<CCodeExpression> get_inner () {
public List<CCodeExpression> get_inner () {
return new ReadOnlyList<CCodeExpression> (inner);
}
......
......@@ -21,7 +21,6 @@
*/
using GLib;
using Gee;
/**
* Represents a local variable declaration in the C code.
......@@ -37,7 +36,7 @@ public class Vala.CCodeDeclaration : CCodeStatement {
*/
public CCodeModifiers modifiers { get; set; }
private Gee.List<CCodeDeclarator> declarators = new ArrayList<CCodeDeclarator> ();
private List<CCodeDeclarator> declarators = new ArrayList<CCodeDeclarator> ();
public CCodeDeclaration (string type_name) {
this.type_name = type_name;
......
......@@ -21,7 +21,6 @@
*/
using GLib;
using Gee;
/**
* Represents an enum in the C code.
......@@ -32,7 +31,7 @@ public class Vala.CCodeEnum : CCodeNode {
*/
public string name { get; set; }
private Gee.List<CCodeEnumValue> values = new ArrayList<CCodeEnumValue> ();
private List<CCodeEnumValue> values = new ArrayList<CCodeEnumValue> ();
public CCodeEnum (string? name = null) {
this.name = name;
......
......@@ -21,7 +21,6 @@
*/
using GLib;
using Gee;
/**
* Represents an enum value in the C code.
......
......@@ -21,7 +21,6 @@
*/
using GLib;
using Gee;
/**
* Represents a for iteration statement in the C code.
......@@ -37,8 +36,8 @@ public class Vala.CCodeForStatement : CCodeStatement {
*/
public CCodeStatement body { get; set; }
private Gee.List<CCodeExpression> initializer = new ArrayList<CCodeExpression> ();
private Gee.List<CCodeExpression> iterator = new ArrayList<CCodeExpression> ();
private List<CCodeExpression> initializer = new ArrayList<CCodeExpression> ();
private List<CCodeExpression> iterator = new ArrayList<CCodeExpression> ();
public CCodeForStatement (CCodeExpression? condition, CCodeStatement? body = null) {
this.condition = condition;
......
......@@ -21,13 +21,12 @@
*/
using GLib;
using Gee;
/**
* Represents a container for C code nodes.
*/
public class Vala.CCodeFragment : CCodeNode {
private Gee.List<CCodeNode> children = new ArrayList<CCodeNode> ();
private List<CCodeNode> children = new ArrayList<CCodeNode> ();
/**
* Appends the specified code node to this code fragment.
......@@ -43,7 +42,7 @@ public class Vala.CCodeFragment : CCodeNode {
*
* @return children list
*/
public Gee.List<CCodeNode> get_children () {
public List<CCodeNode> get_children () {
return new ReadOnlyList<CCodeNode> (children);
}
......
......@@ -21,7 +21,6 @@
*/
using GLib;
using Gee;
/**
* Represents a function declaration in the C code.
......@@ -47,7 +46,7 @@ public class Vala.CCodeFunction : CCodeNode {
*/
public CCodeBlock block { get; set; }
private Gee.List<CCodeFormalParameter> parameters = new ArrayList<CCodeFormalParameter> ();
private List<CCodeFormalParameter> parameters = new ArrayList<CCodeFormalParameter> ();
public CCodeFunction (string name, string return_type = "void") {
this.name = name;
......
......@@ -21,7 +21,6 @@
*/
using GLib;
using Gee;
/**
* Represents a function call in the C code.
......@@ -32,7 +31,7 @@ public class Vala.CCodeFunctionCall : CCodeExpression {
*/
public CCodeExpression? call { get; set; }
private Gee.List<CCodeExpression> arguments = new ArrayList<CCodeExpression> ();
private List<CCodeExpression> arguments = new ArrayList<CCodeExpression> ();
public CCodeFunctionCall (CCodeExpression? call = null) {
this.call = call;
......@@ -56,7 +55,7 @@ public class Vala.CCodeFunctionCall : CCodeExpression {
*
* @return list of arguments
*/
public Gee.List<CCodeExpression> get_arguments () {
public List<CCodeExpression> get_arguments () {
return new ReadOnlyList<CCodeExpression> (arguments);
}
......
......@@ -21,7 +21,6 @@
*/
using GLib;
using Gee;
/**
* Represents a function pointer declarator in the C code.
......@@ -32,7 +31,7 @@ public class Vala.CCodeFunctionDeclarator : CCodeDeclarator {
*/
public string name { get; set; }
private Gee.List<CCodeFormalParameter> parameters = new ArrayList<CCodeFormalParameter> ();
private List<CCodeFormalParameter> parameters = new ArrayList<CCodeFormalParameter> ();
public CCodeFunctionDeclarator (string name) {
this.name = name;
......
......@@ -21,13 +21,12 @@
*/
using GLib;
using Gee;
/**
* Represents a struct or array initializer list in the C code.
*/
public class Vala.CCodeInitializerList : CCodeExpression {
private Gee.List<CCodeExpression> initializers = new ArrayList<CCodeExpression> ();
private List<CCodeExpression> initializers = new ArrayList<CCodeExpression> ();
/**
* Appends the specified expression to this initializer list.
......
......@@ -21,7 +21,6 @@
*/
using GLib;
using Gee;
/**
* Represents a struct declaration in the C code.
......@@ -32,7 +31,7 @@ public class Vala.CCodeStruct : CCodeNode {
*/
public string name { get; set; }
private Gee.List<CCodeDeclaration> declarations = new ArrayList<CCodeDeclaration> ();
private List<CCodeDeclaration> declarations = new ArrayList<CCodeDeclaration> ();
public CCodeStruct (string name) {
this.name = name;
......
......@@ -21,7 +21,6 @@
*/
using GLib;
using Gee;
/**
* Represents a switch selection statement in the C code.
......
......@@ -22,7 +22,6 @@
* Raffaele Sandrini <raffaele@sandrini.ch>
*/
using Gee;
internal class Vala.CCodeArrayModule : CCodeMethodCallModule {
int next_array_dup_id = 0;
......@@ -158,11 +157,11 @@ internal class Vala.CCodeArrayModule : CCodeMethodCallModule {
}
if (array_expr is ArrayCreationExpression) {
Gee.List<Expression> size = ((ArrayCreationExpression) array_expr).get_sizes ();
List<Expression> size = ((ArrayCreationExpression) array_expr).get_sizes ();
var length_expr = size[dim - 1];
return (CCodeExpression) get_ccodenode (length_expr);
} else if (array_expr is MethodCall || array_expr is CastExpression) {
Gee.List<CCodeExpression> size = array_expr.get_array_sizes ();
List<CCodeExpression> size = array_expr.get_array_sizes ();
if (size.size >= dim) {
return size[dim - 1];
}
......@@ -317,7 +316,7 @@ internal class Vala.CCodeArrayModule : CCodeMethodCallModule {
} else if (array_expr.symbol_reference is Property) {
var prop = (Property) array_expr.symbol_reference;
if (!prop.no_array_length) {
Gee.List<CCodeExpression> size = array_expr.get_array_sizes ();
List<CCodeExpression> size = array_expr.get_array_sizes ();
if (size.size >= dim) {
return size[dim - 1];
}
......@@ -385,7 +384,7 @@ internal class Vala.CCodeArrayModule : CCodeMethodCallModule {
public override void visit_element_access (ElementAccess expr) {
expr.accept_children (codegen);
Gee.List<Expression> indices = expr.get_indices ();
List<Expression> indices = expr.get_indices ();
int rank = indices.size;
var container_type = expr.container.value_type.data_type;
......
......@@ -23,7 +23,6 @@
*/
using GLib;
using Gee;
/**
* The link between an assignment and generated code.
......
......@@ -22,7 +22,6 @@
* Raffaele Sandrini <raffaele@sandrini.ch>
*/
using Gee;
/**
* Code visitor generating C Code.
......@@ -143,11 +142,11 @@ internal class Vala.CCodeBaseModule : CCodeModule {
/* temporary variables that own their content */
public ArrayList<LocalVariable> temp_ref_vars = new ArrayList<LocalVariable> ();
/* cache to check whether a certain marshaller has been created yet */
public Gee.Set<string> user_marshal_set;
public Set<string> user_marshal_set;
/* (constant) hash table with all predefined marshallers */
public Gee.Set<string> predefined_marshal_set;
public Set<string> predefined_marshal_set;
/* (constant) hash table with all reserved identifiers in the generated code */
Gee.Set<string> reserved_identifiers;
Set<string> reserved_identifiers;
public int next_temp_var_id = 0;
public bool in_creation_method { get { return current_method is CreationMethod; } }
......@@ -1023,7 +1022,7 @@ internal class Vala.CCodeBaseModule : CCodeModule {
var ma = new MemberAccess (this_access, f.name);
ma.symbol_reference = f;
Gee.List<Expression> sizes = ((ArrayCreationExpression) f.initializer).get_sizes ();
List<Expression> sizes = ((ArrayCreationExpression) f.initializer).get_sizes ();
for (int dim = 1; dim <= array_type.rank; dim++) {
var array_len_lhs = head.get_array_length_cexpression (ma, dim);
var size = sizes[dim - 1];
......@@ -1162,7 +1161,7 @@ internal class Vala.CCodeBaseModule : CCodeModule {
var ma = new MemberAccess.simple (f.name);
ma.symbol_reference = f;
Gee.List<Expression> sizes = ((ArrayCreationExpression) f.initializer).get_sizes ();
List<Expression> sizes = ((ArrayCreationExpression) f.initializer).get_sizes ();
for (int dim = 1; dim <= array_type.rank; dim++) {
var array_len_lhs = head.get_array_length_cexpression (ma, dim);
var size = sizes[dim - 1];
......@@ -2674,7 +2673,7 @@ internal class Vala.CCodeBaseModule : CCodeModule {
}
temp_vars.clear ();
if (((Gee.List<LocalVariable>) temp_ref_vars).size == 0) {
if (((List<LocalVariable>) temp_ref_vars).size == 0) {
/* nothing to do without temporary variables */
return;
}
......@@ -2704,7 +2703,7 @@ internal class Vala.CCodeBaseModule : CCodeModule {
temp_ref_vars.clear ();
}
public void append_temp_decl (CCodeFragment cfrag, Gee.List<LocalVariable> temp_vars) {
public void append_temp_decl (CCodeFragment cfrag, List<LocalVariable> temp_vars) {
foreach (LocalVariable local in temp_vars) {
if (current_method != null && current_method.coroutine) {
closure_struct.add_field (local.variable_type.get_cname (), local.name);
......@@ -2773,7 +2772,7 @@ internal class Vala.CCodeBaseModule : CCodeModule {
/* free temporary objects */
if (((Gee.List<LocalVariable>) temp_vars).size == 0
if (((List<LocalVariable>) temp_vars).size == 0
&& pre_statement_fragment == null) {
/* nothing to do without temporary variables */
return;
......@@ -2802,7 +2801,7 @@ internal class Vala.CCodeBaseModule : CCodeModule {
temp_ref_vars.clear ();
}
public void create_temp_decl (Statement stmt, Gee.List<LocalVariable> temp_vars) {
public void create_temp_decl (Statement stmt, List<LocalVariable> temp_vars) {
/* declare temporary variables */
if (temp_vars.size == 0) {
......@@ -3587,7 +3586,7 @@ internal class Vala.CCodeBaseModule : CCodeModule {
public virtual void generate_error_domain_declaration (ErrorDomain edomain, CCodeDeclarationSpace decl_space) {
}
public void add_generic_type_arguments (Map<int,CCodeExpression> arg_map, Gee.List<DataType> type_args, CodeNode expr, bool is_chainup = false) {
public void add_generic_type_arguments (Map<int,CCodeExpression> arg_map, List<DataType> type_args, CodeNode expr, bool is_chainup = false) {
int type_param_index = 0;
foreach (var type_arg in type_args) {
arg_map.set (get_param_pos (0.1 * type_param_index + 0.01), get_type_id_expression (type_arg, is_chainup));
......
......@@ -23,7 +23,6 @@
*/
using GLib;
using Gee;
internal class Vala.CCodeControlFlowModule : CCodeMethodModule {
public CCodeControlFlowModule (CCodeGenerator codegen, CCodeModule? next) {
......@@ -101,7 +100,7 @@ internal class Vala.CCodeControlFlowModule : CCodeMethodModule {
cswitchblock.append (new CCodeExpressionStatement (free_call));
}
Gee.List<Statement> default_statements = null;
List<Statement> default_statements = null;
label_count = 0;
// generate nested if statements
......
......@@ -20,7 +20,6 @@
* Jürg Billeter <j@bitron.ch>
*/
using Gee;
class Vala.CCodeDeclarationSpace {
public bool is_header { get; set; }
......
......@@ -22,7 +22,6 @@
* Raffaele Sandrini <raffaele@sandrini.ch>
*/
using Gee;
/**
* The link between an assignment and generated code.
......
......@@ -23,7 +23,6 @@
*/
using GLib;
using Gee;
/**
* Code visitor generating C Code.
......
......@@ -23,7 +23,6 @@
*/
using GLib;
using Gee;
internal class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
public CCodeMethodCallModule (CCodeGenerator codegen, CCodeModule? next) {
......@@ -40,7 +39,7 @@ internal class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
Method m = null;
Delegate deleg = null;
Gee.List<FormalParameter> params;
List<FormalParameter> params;
var ma = expr.call as MemberAccess;
......
......@@ -22,7 +22,6 @@
*/
using GLib;
using Gee;
/**
* The link between a method and generated code.
......
......@@ -20,7 +20,6 @@
* Jürg Billeter <j@bitron.ch>
*/
using Gee;
/**
* Code visitor generating C Code.
......@@ -372,11 +371,11 @@ public abstract class Vala.CCodeModule {
return next.get_dynamic_signal_disconnect_wrapper_name (node);
}
public virtual void generate_marshaller (Gee.List<FormalParameter> params, DataType return_type, bool dbus = false) {
public virtual void generate_marshaller (List<FormalParameter> params, DataType return_type, bool dbus = false) {
next.generate_marshaller (params, return_type, dbus);
}
public virtual string get_marshaller_function (Gee.List<FormalParameter> params, DataType return_type, string? prefix = null, bool dbus = false) {
public virtual string get_marshaller_function (List<FormalParameter> params, DataType return_type, string? prefix = null, bool dbus = false) {
return next.get_marshaller_function (params, return_type, prefix, dbus);
}
......
......@@ -23,7 +23,6 @@
*/
using GLib;
using Gee;
/**
* The link between a dynamic method and generated code.
......@@ -45,7 +44,7 @@ internal class Vala.DBusClientModule : DBusModule {
}
}
bool has_dbus_error (Gee.List<DataType> error_types) {
bool has_dbus_error (List<DataType> error_types) {
foreach (DataType error_type in error_types) {
if (((ErrorType) error_type).error_domain.get_full_name () == "DBus.Error") {
return true;
......@@ -1642,7 +1641,7 @@ internal class Vala.DBusClientModule : DBusModule {
return proxy_name;
}
void generate_client_error_cases (CCodeBlock error_block, Gee.List<DataType> error_types, CCodeExpression dbus_error_name, CCodeExpression result_edomain, CCodeExpression result_ecode) {
void generate_client_error_cases (CCodeBlock error_block, List<DataType> error_types, CCodeExpression dbus_error_name, CCodeExpression result_edomain, CCodeExpression result_ecode) {
CCodeStatement if_else_if = null;
CCodeIfStatement last_statement = null;
......
......@@ -23,7 +23,6 @@
*/
using GLib;
using Gee;
/**
* The link between a dynamic method and generated code.
......@@ -421,7 +420,7 @@ internal class Vala.DBusServerModule : DBusClientModule {
return wrapper_name;
}
void generate_server_error_cases (CCodeBlock error_block, Gee.List<DataType> error_types, CCodeExpression error, CCodeExpression message, CCodeExpression reply) {
void generate_server_error_cases (CCodeBlock error_block, List<DataType> error_types, CCodeExpression error, CCodeExpression message, CCodeExpression reply) {
CCodeStatement if_else_if = null;
CCodeIfStatement last_statement = null;
......
......@@ -21,7 +21,6 @@
*/
using GLib;
using Gee;
internal class Vala.GAsyncModule : GSignalModule {
public GAsyncModule (CCodeGenerator codegen, CCodeModule? next) {
......@@ -517,7 +516,7 @@ internal class Vala.GAsyncModule : GSignalModule {
/* free temporary objects */
if (((Gee.List<LocalVariable>) temp_vars).size == 0) {
if (((List<LocalVariable>) temp_vars).size == 0) {
/* nothing to do without temporary variables */
return;
}
......
......@@ -22,7 +22,6 @@
*/
using GLib;
using Gee;
internal class Vala.GErrorModule : CCodeDelegateModule {
private int current_try_id = 0;
......
......@@ -21,7 +21,6 @@
*/
using GLib;
using Gee;
/**
* Code visitor generating .gir file for the public interface.
......@@ -84,7 +83,7 @@ public class Vala.GIRWriter : CodeVisitor {
private void write_c_includes (Namespace ns) {
// Collect C header filenames
Gee.Set<string> header_filenames = new Gee.HashSet<string> (str_hash, str_equal);
Set<string> header_filenames = new HashSet<string> (str_hash, str_equal);
foreach (string c_header_filename in ns.get_cheader_filenames ()) {
header_filenames.add (c_header_filename);
}
......@@ -455,7 +454,7 @@ public class Vala.GIRWriter : CodeVisitor {
}
}
private void write_params_and_return (Gee.List<FormalParameter> params, DataType? return_type, bool return_array_length, bool constructor = false, DataType? instance_type = null) {
private void write_params_and_return (List<FormalParameter> params, DataType? return_type, bool return_array_length, bool constructor = false, DataType? instance_type = null) {
int last_index = 0;
if (params.size != 0 || instance_type != null || (return_type is ArrayType && return_array_length) || (return_type is DelegateType)) {
write_indent ();
......@@ -550,7 +549,7 @@ public class Vala.GIRWriter : CodeVisitor {
}
}
private void do_write_signature (Method m, string tag_name, bool instance, string name, string cname, Gee.List<Vala.FormalParameter> params, DataType return_type, bool can_fail) {
private void do_write_signature (Method m, string tag_name, bool instance, string name, string cname, List<Vala.FormalParameter> params, DataType return_type, bool can_fail) {
write_indent ();
stream.printf ("<%s name=\"%s\"", tag_name, name);
if (tag_name == "virtual-method") {
......@@ -753,7 +752,7 @@ public class Vala.GIRWriter : CodeVisitor {
write_indent ();
stream.printf ("<type name=\"%s\" c:type=\"%s\"", gi_type_name (type.data_type), type.get_cname ());
Gee.List<DataType> type_arguments = type.get_type_arguments ();
List<DataType> type_arguments = type.get_type_arguments ();
if (type_arguments.size == 0) {
stream.printf ("/>\n");
} else {
......
......@@ -22,7 +22,6 @@
* Raffaele Sandrini <raffaele@sandrini.ch>
*/
using Gee;
internal class Vala.GObjectModule : GTypeModule {
int dynamic_property_id;
......
......@@ -22,7 +22,6 @@
* Raffaele Sandrini <raffaele@sandrini.ch>
*/
using Gee;
internal class Vala.GSignalModule : GObjectModule {
public GSignalModule (CCodeGenerator codegen, CCodeModule? next) {
......@@ -72,7 +71,7 @@ internal class Vala.GSignalModule : GObjectModule {
}
}
public override string get_marshaller_function (Gee.List<FormalParameter> params, DataType return_type, string? prefix = null, bool dbus = false) {
public override string get_marshaller_function (List<FormalParameter> params, DataType return_type, string? prefix = null, bool dbus = false) {
var signature = get_marshaller_signature (params, return_type, dbus);
string ret;
......@@ -132,7 +131,7 @@ internal class Vala.GSignalModule : GObjectModule {
}
}
private string get_marshaller_signature (Gee.List<FormalParameter> params, DataType return_type, bool dbus = false) {
private string get_marshaller_signature (List<FormalParameter> params, DataType return_type, bool dbus = false) {
string signature;
signature = "%s:".printf (get_marshaller_type_name (return_type, dbus));
......@@ -173,7 +172,7 @@ internal class Vala.GSignalModule : GObjectModule {
generate_marshaller (sig.get_parameters (), sig.return_type);
}
public override void generate_marshaller (Gee.List<FormalParameter> params, DataType return_type, bool dbus = false) {
public override void generate_marshaller (List<FormalParameter> params, DataType return_type, bool dbus = false) {
string signature;
int n_params, i;
......
......@@ -22,7 +22,6 @@
* Raffaele Sandrini <raffaele@sandrini.ch>
*/
using Gee;
internal class Vala.GTypeModule : GErrorModule {
public GTypeModule (CCodeGenerator codegen, CCodeModule? next) {
......
......@@ -36,11 +36,11 @@ libgee_la_SOURCES = \
geeincludedir = $(includedir)/vala-1.0
geeinclude_HEADERS = \
gee.h \
valagee.h \
$(NULL)
gee.vapi gee.vala.stamp: $(libgee_la_VALASOURCES)
$(VALAC) $(COVERAGE_VALAFLAGS) $(VALAFLAGS) -C --vapidir $(srcdir)/../vapi --pkg gobject-2.0 -H gee.h --library gee $^
$(VALAC) $(COVERAGE_VALAFLAGS) $(VALAFLAGS) -C --vapidir $(srcdir)/../vapi --pkg gobject-2.0 -H valagee.h --library gee $^
touch $@
libgee_la_LIBADD = \
......@@ -52,7 +52,7 @@ EXTRA_DIST = $(libgee_la_VALASOURCES) gee.vapi gee.vala.stamp
MAINTAINERCLEANFILES = \
gee.vapi \
gee.h \
valagee.h \
$(libgee_la_VALASOURCES:.vala=.c) \
$(NULL)
......@@ -27,7 +27,7 @@ using GLib;
/**
* Arrays of arbitrary elements which grow automatically as elements are added.
*/
public class Gee.ArrayList<G> : CollectionObject, Iterable<G>, Collection<G>, List<G> {
public class Vala.ArrayList<G> : CollectionObject, Iterable<G>, Collection<G>, List<G> {
public int size {
get { return _size; }
}
......@@ -51,7 +51,7 @@ public class Gee.ArrayList<G> : CollectionObject, Iterable<G>, Collection<G>, Li
return typeof (G);
}
public Gee.Iterator<G> iterator () {
public Vala.Iterator<G> iterator () {
return new Iterator<G> (this);
}
......@@ -152,7 +152,7 @@ public class Gee.ArrayList<G> : CollectionObject, Iterable<G>, Collection<G>, Li
_items.resize (value);
}
private class Iterator<G> : CollectionObject, Gee.Iterator<G> {
private class Iterator<G> : CollectionObject, Vala.Iterator<G> {
public ArrayList<G> list {
set {
_list = value;
......
......@@ -24,7 +24,7 @@
* Serves as the base interface for implementing collection classes. Defines
* size, iteration, and modification methods.
*/
public interface Gee.Collection<G> : Iterable<G> {
public interface Vala.Collection<G> : Iterable<G> {
/**
* The number of items in this collection.
*/
......
......@@ -25,6 +25,6 @@ using GLib;