+2007-07-21 Jürg Billeter <j@bitron.ch>
+
+ * vala/Makefile.am, vala/parser.y, vala/scanner.l, vala/vala.h,
+ vala/valaarray.vala, vala/valaarraylengthfield.vala,
+ vala/valaarrayresizemethod.vala, vala/valaattributeprocessor.vala,
+ vala/valablock.vala, vala/valabreakstatement.vala,
+ vala/valacallback.vala, vala/valaclass.vala,
+ vala/valacodecontext.vala, vala/valacodenode.vala,
+ vala/valacodevisitor.vala, vala/valaconstant.vala,
+ vala/valaconstructor.vala, vala/valacontinuestatement.vala,
+ vala/valacreationmethod.vala, vala/valadatatype.vala,
+ vala/valadeclarationstatement.vala, vala/valadestructor.vala,
+ vala/valadostatement.vala, vala/valaemptystatement.vala,
+ vala/valaenum.vala, vala/valaenumvalue.vala,
+ vala/valaexpressionstatement.vala, vala/valafield.vala,
+ vala/valaflags.vala, vala/valaflagsvalue.vala,
+ vala/valaforeachstatement.vala, vala/valaformalparameter.vala,
+ vala/valaforstatement.vala, vala/valaifstatement.vala,
+ vala/valainterface.vala, vala/valainterfacewriter.vala,
+ vala/valalockstatement.vala, vala/valamember.vala,
+ vala/valamemorymanager.vala, vala/valamethod.vala,
+ vala/valanamespace.vala, vala/valaproperty.vala,
+ vala/valapropertyaccessor.vala, vala/valareturnstatement.vala,
+ vala/valascope.vala, vala/valasemanticanalyzer.vala,
+ vala/valasignal.vala, vala/valasourcefile.vala,
+ vala/valastatement.vala, vala/valastruct.vala,
+ vala/valaswitchstatement.vala, vala/valasymbol.vala,
+ vala/valasymbolbuilder.vala, vala/valasymbolresolver.vala,
+ vala/valathrowstatement.vala, vala/valatrystatement.vala,
+ vala/valatypeparameter.vala, vala/valatypereference.vala,
+ vala/valavariabledeclarator.vala, vala/valawhilestatement.vala,
+ gobject/valacodegenerator.vala,
+ gobject/valacodegeneratorassignment.vala,
+ gobject/valacodegeneratorclass.vala,
+ gobject/valacodegeneratorinterface.vala,
+ gobject/valacodegeneratorinvocationexpression.vala,
+ gobject/valacodegeneratormemberaccess.vala,
+ gobject/valacodegeneratormethod.vala,
+ gobject/valacodegeneratorsignal.vala,
+ gobject/valacodegeneratorstruct.vala, compiler/valacompiler.vala,
+ vapi/atk.vala, vapi/gdk-2.0.vala, vapi/gio-standalone.vala,
+ vapi/glib-2.0.vala, vapi/gstreamer-0.10.vala, vapi/gtk+-2.0.vala,
+ vapi/packages/gstreamer-0.10/gstreamer-0.10-custom.vala,
+ vapi/packages/gtk+-2.0/gtk+-2.0-custom.vala, vapi/pango.vala,
+ vapi/vte.vala, vapigen/valagidlparser.vala, vapigen/valavapigen.vala:
+ derive from Symbol class where appropriate and move symbol table into
+ separate Scope class
+
2007-07-21 Raffaele Sandrini <raffaele@sandrini.ch>
* vapi/zlib.vala: add basic zlib support
return quit ();
}
- var builder = new SymbolBuilder ();
- builder.build (context);
-
- if (Report.get_errors () > 0) {
- return quit ();
- }
-
var attributeprocessor = new AttributeProcessor ();
attributeprocessor.process (context);
root_symbol = context.root;
bool_type = new TypeReference ();
- bool_type.data_type = (DataType) root_symbol.lookup ("bool").node;
+ bool_type.data_type = (DataType) root_symbol.scope.lookup ("bool");
char_type = new TypeReference ();
- char_type.data_type = (DataType) root_symbol.lookup ("char").node;
+ char_type.data_type = (DataType) root_symbol.scope.lookup ("char");
unichar_type = new TypeReference ();
- unichar_type.data_type = (DataType) root_symbol.lookup ("unichar").node;
+ unichar_type.data_type = (DataType) root_symbol.scope.lookup ("unichar");
short_type = new TypeReference ();
- short_type.data_type = (DataType) root_symbol.lookup ("short").node;
+ short_type.data_type = (DataType) root_symbol.scope.lookup ("short");
ushort_type = new TypeReference ();
- ushort_type.data_type = (DataType) root_symbol.lookup ("ushort").node;
+ ushort_type.data_type = (DataType) root_symbol.scope.lookup ("ushort");
int_type = new TypeReference ();
- int_type.data_type = (DataType) root_symbol.lookup ("int").node;
+ int_type.data_type = (DataType) root_symbol.scope.lookup ("int");
uint_type = new TypeReference ();
- uint_type.data_type = (DataType) root_symbol.lookup ("uint").node;
+ uint_type.data_type = (DataType) root_symbol.scope.lookup ("uint");
long_type = new TypeReference ();
- long_type.data_type = (DataType) root_symbol.lookup ("long").node;
+ long_type.data_type = (DataType) root_symbol.scope.lookup ("long");
ulong_type = new TypeReference ();
- ulong_type.data_type = (DataType) root_symbol.lookup ("ulong").node;
+ ulong_type.data_type = (DataType) root_symbol.scope.lookup ("ulong");
int64_type = new TypeReference ();
- int64_type.data_type = (DataType) root_symbol.lookup ("int64").node;
+ int64_type.data_type = (DataType) root_symbol.scope.lookup ("int64");
uint64_type = new TypeReference ();
- uint64_type.data_type = (DataType) root_symbol.lookup ("uint64").node;
+ uint64_type.data_type = (DataType) root_symbol.scope.lookup ("uint64");
float_type = new TypeReference ();
- float_type.data_type = (DataType) root_symbol.lookup ("float").node;
+ float_type.data_type = (DataType) root_symbol.scope.lookup ("float");
double_type = new TypeReference ();
- double_type.data_type = (DataType) root_symbol.lookup ("double").node;
+ double_type.data_type = (DataType) root_symbol.scope.lookup ("double");
string_type = new TypeReference ();
- string_type.data_type = (DataType) root_symbol.lookup ("string").node;
- substring_method = (Method) string_type.data_type.symbol.lookup ("substring").node;
+ string_type.data_type = (DataType) root_symbol.scope.lookup ("string");
+ substring_method = (Method) string_type.data_type.scope.lookup ("substring");
- var glib_ns = root_symbol.lookup ("GLib");
+ var glib_ns = root_symbol.scope.lookup ("GLib");
- list_type = (DataType) glib_ns.lookup ("List").node;
- slist_type = (DataType) glib_ns.lookup ("SList").node;
+ list_type = (DataType) glib_ns.scope.lookup ("List");
+ slist_type = (DataType) glib_ns.scope.lookup ("SList");
mutex_type = new TypeReference ();
- mutex_type.data_type = (DataType) glib_ns.lookup ("Mutex").node;
+ mutex_type.data_type = (DataType) glib_ns.scope.lookup ("Mutex");
- type_module_type = (DataType) glib_ns.lookup ("TypeModule").node;
+ type_module_type = (DataType) glib_ns.scope.lookup ("TypeModule");
if (context.module_init_method != null) {
module_init_fragment = new CCodeFragment ();
cenum.add_value (ev.get_cname (), val);
}
- public override void visit_flags (Flags! fl) {
- cenum = new CCodeEnum (fl.get_cname ());
-
- if (fl.source_reference.comment != null) {
- header_type_definition.append (new CCodeComment (fl.source_reference.comment));
- }
- header_type_definition.append (cenum);
-
- fl.accept_children (this);
- }
-
- public override void visit_flags_value (FlagsValue! fv) {
- string val;
- if (fv.value is LiteralExpression) {
- var lit = ((LiteralExpression) fv.value).literal;
- if (lit is IntegerLiteral) {
- val = ((IntegerLiteral) lit).value;
- }
- }
- cenum.add_value (fv.get_cname (), val);
- }
-
public override void visit_callback (Callback! cb) {
cb.accept_children (this);
public override void visit_member (Member! m) {
/* stuff meant for all lockable members */
if (m is Lockable && ((Lockable)m).get_lock_used ()) {
- instance_priv_struct.add_field (mutex_type.get_cname (), get_symbol_lock_name (m.symbol));
+ instance_priv_struct.add_field (mutex_type.get_cname (), get_symbol_lock_name (m));
instance_init_fragment.append (
new CCodeExpressionStatement (
new CCodeAssignment (
new CCodeMemberAccess.pointer (
new CCodeMemberAccess.pointer (new CCodeIdentifier ("self"), "priv"),
- get_symbol_lock_name (m.symbol)),
+ get_symbol_lock_name (m)),
new CCodeFunctionCall (new CCodeIdentifier (((Struct)mutex_type.data_type).default_construction_method.get_cname ())))));
var fc = new CCodeFunctionCall (new CCodeIdentifier ("VALA_FREE_CHECKED"));
fc.add_argument (
new CCodeMemberAccess.pointer (
new CCodeMemberAccess.pointer (new CCodeIdentifier ("self"), "priv"),
- get_symbol_lock_name (m.symbol)));
+ get_symbol_lock_name (m)));
fc.add_argument (new CCodeIdentifier (mutex_type.data_type.get_free_function ()));
if (instance_dispose_fragment != null) {
instance_dispose_fragment.append (new CCodeExpressionStatement (fc));
public override void visit_constant (Constant! c) {
c.accept_children (this);
- if (c.symbol.parent_symbol.node is DataType) {
- var t = (DataType) c.symbol.parent_symbol.node;
+ if (c.parent_symbol is DataType) {
+ var t = (DataType) c.parent_symbol;
var cdecl = new CCodeDeclaration (c.type_reference.get_const_cname ());
var arr = "";
if (c.type_reference.data_type is Array) {
st = instance_priv_struct;
lhs = new CCodeMemberAccess.pointer (new CCodeMemberAccess.pointer (new CCodeIdentifier ("self"), "priv"), f.get_cname ());
} else {
- if (f.symbol.parent_symbol.node is DataType) {
- var t = (DataType) f.symbol.parent_symbol.node;
+ if (f.parent_symbol is DataType) {
+ var t = (DataType) f.parent_symbol;
var cdecl = new CCodeDeclaration (f.type_reference.get_cname ());
var var_decl = new CCodeVariableDeclarator (f.get_cname ());
if (f.initializer != null) {
if (f.type_reference.data_type is Array && !f.no_array_length &&
f.initializer is ArrayCreationExpression) {
var ma = new MemberAccess.simple (f.name);
- ma.symbol_reference = f.symbol;
+ ma.symbol_reference = f;
var array_len_lhs = get_array_length_cexpression (ma, 1);
var sizes = ((ArrayCreationExpression) f.initializer).get_sizes ();
public override void visit_property (Property! prop) {
prop.accept_children (this);
- prop_enum.add_value (prop.get_upper_case_cname (), null);
+ if (prop.parent_symbol is Class) {
+ prop_enum.add_value (prop.get_upper_case_cname (), null);
+ }
}
public override void visit_property_accessor (PropertyAccessor! acc) {
- var prop = (Property) acc.symbol.parent_symbol.node;
+ var prop = (Property) acc.prop;
if (acc.readable) {
current_return_type = prop.type_reference;
current_return_type = null;
- var t = (DataType) prop.symbol.parent_symbol.node;
+ var t = (DataType) prop.parent_symbol;
var this_type = new TypeReference ();
this_type.data_type = t;
c.accept_children (this);
- var cl = (Class) c.symbol.parent_symbol.node;
+ var cl = (Class) c.parent_symbol;
function = new CCodeFunction ("%s_constructor".printf (cl.get_lower_case_cname (null)), "GObject *");
function.modifiers = CCodeModifiers.STATIC;
}
public override void visit_begin_block (Block! b) {
- current_symbol = b.symbol;
+ current_symbol = b;
}
private void add_object_creation (CCodeBlock! b) {
- var cl = (Class) current_type_symbol.node;
+ var cl = (Class) current_type_symbol;
var ccall = new CCodeFunctionCall (new CCodeIdentifier ("g_object_newv"));
ccall.add_argument (new CCodeConstant (cl.get_type_id ()));
public override void visit_end_block (Block! b) {
var local_vars = b.get_local_variables ();
foreach (VariableDeclarator decl in local_vars) {
- decl.symbol.active = false;
+ decl.active = false;
}
var cblock = new CCodeBlock ();
- foreach (Statement stmt in b.get_statements ()) {
+ foreach (CodeNode stmt in b.get_statements ()) {
var src = stmt.source_reference;
if (src != null && src.comment != null) {
cblock.add_statement (new CCodeComment (src.comment));
cfrag.append (new CCodeExpressionStatement (czero));
} else {
- Report.warning (decl.source_reference, "unable to initialize a variable of type `%s'".printf (decl.type_reference.data_type.symbol.get_full_name ()));
+ Report.warning (decl.source_reference, "unable to initialize a variable of type `%s'".printf (decl.type_reference.data_type.get_full_name ()));
}
}
}
decl.ccodenode = new CCodeVariableDeclarator.with_initializer (get_variable_cname (decl.name), rhs);
- decl.symbol.active = true;
+ decl.active = true;
}
public override void visit_end_initializer_list (InitializerList! list) {
unref_function = type.data_type.get_free_function ();
}
return new CCodeIdentifier (unref_function);
- } else if (type.type_parameter != null && current_class != null) {
+ } else if (type.type_parameter != null && current_type_symbol is Class) {
string func_name = "%s_destroy_func".printf (type.type_parameter.name.down ());
return new CCodeMemberAccess.pointer (new CCodeMemberAccess.pointer (new CCodeIdentifier ("self"), "priv"), func_name);
} else {
var cisnull = new CCodeBinaryExpression (CCodeBinaryOperator.EQUALITY, cvar, new CCodeConstant ("NULL"));
if (type.data_type == null) {
- if (current_class == null) {
+ if (!(current_type_symbol is Class)) {
return new CCodeConstant ("NULL");
}
var cfrag = new CCodeFragment ();
append_temp_decl (cfrag, temp_vars);
- cfrag.append (stmt.ccodenode);
+ // FIXME cast to CodeNode shouldn't be necessary as Statement requires CodeNode
+ cfrag.append (((CodeNode) stmt).ccodenode);
- stmt.ccodenode = cfrag;
+ ((CodeNode) stmt).ccodenode = cfrag;
}
public override void visit_if_statement (IfStatement! stmt) {
}
var cblock = new CCodeBlock ();
- foreach (Statement body_stmt in section.get_statements ()) {
+ foreach (CodeNode body_stmt in section.get_statements ()) {
if (body_stmt.ccodenode is CCodeFragment) {
foreach (CCodeStatement cstmt in ((CCodeFragment) body_stmt.ccodenode).get_children ()) {
cblock.add_statement (cstmt);
if (default_statements != null) {
var cblock = new CCodeBlock ();
- foreach (Statement body_stmt in default_statements) {
+ foreach (CodeNode body_stmt in default_statements) {
cblock.add_statement ((CCodeStatement) body_stmt.ccodenode);
}
}
private void append_local_free (Symbol sym, CCodeFragment cfrag, bool stop_at_loop) {
- var b = (Block) sym.node;
+ var b = (Block) sym;
var local_vars = b.get_local_variables ();
foreach (VariableDeclarator decl in local_vars) {
- if (decl.symbol.active && decl.type_reference.data_type.is_reference_type () && decl.type_reference.takes_ownership) {
+ if (decl.active && decl.type_reference.data_type.is_reference_type () && decl.type_reference.takes_ownership) {
cfrag.append (new CCodeExpressionStatement (get_unref_expression (new CCodeIdentifier (get_variable_cname (decl.name)), decl.type_reference)));
}
}
- if (sym.parent_symbol.node is Block) {
+ if (sym.parent_symbol is Block) {
append_local_free (sym.parent_symbol, cfrag, stop_at_loop);
}
}
- private void create_local_free (Statement stmt) {
+ private void create_local_free (CodeNode stmt) {
if (!memory_management) {
return;
}
private bool append_local_free_expr (Symbol sym, CCodeCommaExpression ccomma, bool stop_at_loop) {
var found = false;
- var b = (Block) sym.node;
+ var b = (Block) sym;
var local_vars = b.get_local_variables ();
foreach (VariableDeclarator decl in local_vars) {
- if (decl.symbol.active && decl.type_reference.data_type.is_reference_type () && decl.type_reference.takes_ownership) {
+ if (decl.active && decl.type_reference.data_type.is_reference_type () && decl.type_reference.takes_ownership) {
found = true;
ccomma.append_expression (get_unref_expression (new CCodeIdentifier (get_variable_cname (decl.name)), decl.type_reference));
}
}
- if (sym.parent_symbol.node is Block) {
+ if (sym.parent_symbol is Block) {
found = found || append_local_free_expr (sym.parent_symbol, ccomma, stop_at_loop);
}
if (stmt.return_expression != null) {
// avoid unnecessary ref/unref pair
if (stmt.return_expression.ref_missing &&
- stmt.return_expression.symbol_reference != null &&
- stmt.return_expression.symbol_reference.node is VariableDeclarator) {
- var decl = (VariableDeclarator) stmt.return_expression.symbol_reference.node;
+ stmt.return_expression.symbol_reference is VariableDeclarator) {
+ var decl = (VariableDeclarator) stmt.return_expression.symbol_reference;
if (decl.type_reference.takes_ownership) {
/* return expression is local variable taking ownership and
* current method is transferring ownership */
// avoid unnecessary ref/unref pair
if (stmt.return_expression.ref_sink &&
- stmt.return_expression.symbol_reference != null &&
- stmt.return_expression.symbol_reference.node is VariableDeclarator) {
- var decl = (VariableDeclarator) stmt.return_expression.symbol_reference.node;
+ stmt.return_expression.symbol_reference is VariableDeclarator) {
+ var decl = (VariableDeclarator) stmt.return_expression.symbol_reference;
if (decl.type_reference.takes_ownership) {
/* return expression is local variable taking ownership and
* current method is transferring ownership */
// don't unref expression
- return_expression_symbol = decl.symbol;
+ return_expression_symbol = decl;
return_expression_symbol.active = false;
}
}
if (inner_node == null) {
l = new CCodeIdentifier ("self");
- } else if (stmt.resource.symbol_reference.parent_symbol.node != current_class) {
- l = new CCodeFunctionCall (new CCodeIdentifier (((DataType) stmt.resource.symbol_reference.parent_symbol.node).get_upper_case_cname ()));
+ } else if (stmt.resource.symbol_reference.parent_symbol != current_type_symbol) {
+ l = new CCodeFunctionCall (new CCodeIdentifier (((DataType) stmt.resource.symbol_reference.parent_symbol).get_upper_case_cname ()));
((CCodeFunctionCall) l).add_argument ((CCodeExpression)inner_node.ccodenode);
} else {
l = (CCodeExpression)inner_node.ccodenode;
}
l = new CCodeMemberAccess.pointer (new CCodeMemberAccess.pointer (l, "priv"), get_symbol_lock_name (stmt.resource.symbol_reference));
- fc = new CCodeFunctionCall (new CCodeIdentifier (((Method)mutex_type.data_type.symbol.lookup ("lock").node).get_cname ()));
+ fc = new CCodeFunctionCall (new CCodeIdentifier (((Method) mutex_type.data_type.scope.lookup ("lock")).get_cname ()));
fc.add_argument (l);
cn.append (new CCodeExpressionStatement (fc));
cn.append (stmt.body.ccodenode);
- fc = new CCodeFunctionCall (new CCodeIdentifier (((Method)mutex_type.data_type.symbol.lookup ("unlock").node).get_cname ()));
+ fc = new CCodeFunctionCall (new CCodeIdentifier (((Method) mutex_type.data_type.scope.lookup ("unlock")).get_cname ()));
fc.add_argument (l);
cn.append (new CCodeExpressionStatement (fc));
List<weak CCodeExpression> size = invocation_expr.get_array_sizes ();
return size.nth_data (dim - 1);
} else if (array_expr.symbol_reference != null) {
- if (array_expr.symbol_reference.node is FormalParameter) {
- var param = (FormalParameter) array_expr.symbol_reference.node;
+ if (array_expr.symbol_reference is FormalParameter) {
+ var param = (FormalParameter) array_expr.symbol_reference;
if (!param.no_array_length) {
var length_expr = new CCodeIdentifier (get_array_length_cname (param.name, dim));
if (is_out) {
return length_expr;
}
}
- } else if (array_expr.symbol_reference.node is VariableDeclarator) {
- var decl = (VariableDeclarator) array_expr.symbol_reference.node;
+ } else if (array_expr.symbol_reference is VariableDeclarator) {
+ var decl = (VariableDeclarator) array_expr.symbol_reference;
var length_expr = new CCodeIdentifier (get_array_length_cname (decl.name, dim));
if (is_out) {
return new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, length_expr);
} else {
return length_expr;
}
- } else if (array_expr.symbol_reference.node is Field) {
- var field = (Field) array_expr.symbol_reference.node;
+ } else if (array_expr.symbol_reference is Field) {
+ var field = (Field) array_expr.symbol_reference;
if (!field.no_array_length) {
var length_cname = get_array_length_cname (field.name, dim);
if (current_type_symbol != null) {
/* base type is available if this is a type method */
- base_type = (DataType) current_type_symbol.node;
+ base_type = (DataType) current_type_symbol;
}
} else {
pub_inst = (CCodeExpression) ma.inner.ccodenode;
if (field.instance) {
CCodeExpression typed_inst;
- if (field.symbol.parent_symbol.node != base_type) {
+ if (field.parent_symbol != base_type) {
// FIXME: use C cast if debugging disabled
- typed_inst = new CCodeFunctionCall (new CCodeIdentifier (((DataType) field.symbol.parent_symbol.node).get_upper_case_cname (null)));
+ typed_inst = new CCodeFunctionCall (new CCodeIdentifier (((DataType) field.parent_symbol).get_upper_case_cname (null)));
((CCodeFunctionCall) typed_inst).add_argument (pub_inst);
} else {
typed_inst = pub_inst;
} else {
inst = typed_inst;
}
- if (((DataType) field.symbol.parent_symbol.node).is_reference_type ()) {
+ if (((DataType) field.parent_symbol).is_reference_type ()) {
length_expr = new CCodeMemberAccess.pointer (inst, length_cname);
} else {
length_expr = new CCodeMemberAccess (inst, length_cname);
MemberAccess ma = find_property_access (expr.inner);
if (ma != null) {
// property postfix expression
- var prop = (Property) ma.symbol_reference.node;
+ var prop = (Property) ma.symbol_reference;
var ccomma = new CCodeCommaExpression ();
}
var ma = (MemberAccess) expr;
- if (ma.symbol_reference.node is Property) {
+ if (ma.symbol_reference is Property) {
return ma;
}
expr.ccodenode = ccall;
}
- } else if (expr.symbol_reference.node is Method) {
+ } else if (expr.symbol_reference is Method) {
// use creation method
- var m = (Method) expr.symbol_reference.node;
+ var m = (Method) expr.symbol_reference;
var params = m.get_parameters ();
var ccall = new CCodeFunctionCall (new CCodeIdentifier (m.get_cname ()));
}
expr.ccodenode = ccall;
- } else if (expr.symbol_reference.node is EnumValue) {
+ } else if (expr.symbol_reference is EnumValue) {
// error code
- var ev = (EnumValue) expr.symbol_reference.node;
- var en = (Enum) ev.symbol.parent_symbol.node;
+ var ev = (EnumValue) expr.symbol_reference;
+ var en = (Enum) ev.parent_symbol;
var ccall = new CCodeFunctionCall (new CCodeIdentifier ("g_set_error"));
ccall.add_argument (new CCodeIdentifier ("error"));
ma = (MemberAccess)a.left;
}
- if (a.left.symbol_reference != null && a.left.symbol_reference.node is Property) {
- var prop = (Property) a.left.symbol_reference.node;
+ if (a.left.symbol_reference is Property) {
+ var prop = (Property) a.left.symbol_reference;
- if (current_class != null && ma.inner == null && in_creation_method) {
+ if (current_type_symbol is Class && ma.inner == null && in_creation_method) {
// this property is used as a construction parameter
var cpointer = new CCodeIdentifier ("__params_it");
a.ccodenode = ccomma;
}
- } else if (a.left.symbol_reference != null && a.left.symbol_reference.node is Signal) {
- var sig = (Signal) a.left.symbol_reference.node;
+ } else if (a.left.symbol_reference is Signal) {
+ var sig = (Signal) a.left.symbol_reference;
- var m = (Method) a.right.symbol_reference.node;
+ var m = (Method) a.right.symbol_reference;
string connect_func;
bool disconnect = false;
temp_vars.prepend (temp_decl);
var parse_call = new CCodeFunctionCall (new CCodeIdentifier ("g_signal_parse_name"));
parse_call.add_argument (sig.get_canonical_cconstant ());
- var decl_type = (DataType) sig.symbol.parent_symbol.node;
+ var decl_type = (DataType) sig.parent_symbol;
parse_call.add_argument (new CCodeIdentifier (decl_type.get_type_id ()));
parse_call.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier (temp_decl.name)));
parse_call.add_argument (new CCodeConstant ("NULL"));
}
private CCodeFunctionCall get_property_set_call (Property! prop, MemberAccess! ma, CCodeExpression! cexpr) {
- var cl = (Class) prop.symbol.parent_symbol.node;
+ var cl = (Class) prop.parent_symbol;
var set_func = "g_object_set";
var base_property = prop;
} else if (prop.base_interface_property != null) {
base_property = prop.base_interface_property;
}
- var base_property_type = (DataType) base_property.symbol.parent_symbol.node;
+ var base_property_type = (DataType) base_property.parent_symbol;
set_func = "%s_set_%s".printf (base_property_type.get_lower_case_cname (null), base_property.name);
}
if (ma.inner == null) {
instance = new CCodeIdentifier ("self");
/* require casts for inherited properties */
- req_cast = (base_property.symbol.parent_symbol != current_type_symbol);
+ req_cast = (base_property.parent_symbol != current_type_symbol);
} else {
instance = (CCodeExpression) ma.inner.ccodenode;
/* require casts if the type of the used instance is
* different than the type which declared the property */
- req_cast = base_property.symbol.parent_symbol.node != ma.inner.static_type.data_type;
+ req_cast = base_property.parent_symbol != ma.inner.static_type.data_type;
}
- if (req_cast && ((DataType) prop.symbol.parent_symbol.node).is_reference_type ()) {
- var ccast = new CCodeFunctionCall (new CCodeIdentifier (((DataType) base_property.symbol.parent_symbol.node).get_upper_case_cname (null)));
+ if (req_cast && ((DataType) prop.parent_symbol).is_reference_type ()) {
+ var ccast = new CCodeFunctionCall (new CCodeIdentifier (((DataType) base_property.parent_symbol).get_upper_case_cname (null)));
ccast.add_argument (instance);
instance = ccast;
}
public class Vala.CodeGenerator {
public override void visit_class (Class! cl) {
- current_symbol = cl.symbol;
- current_type_symbol = cl.symbol;
+ var old_symbol = current_symbol;
+ var old_type_symbol = current_type_symbol;
+ var old_class = current_class;
+ var old_instance_struct = instance_struct;
+ var old_type_struct = type_struct;
+ var old_instance_priv_struct = instance_priv_struct;
+ var old_prop_enum = prop_enum;
+ var old_instance_init_fragment = instance_init_fragment;
+ var old_instance_dispose_fragment = instance_dispose_fragment;
+ current_symbol = cl;
+ current_type_symbol = cl;
current_class = cl;
if (cl.is_static) {
}
}
- current_type_symbol = null;
- current_class = null;
- instance_dispose_fragment = null;
+ current_type_symbol = old_type_symbol;
+ current_class = old_class;
+ instance_dispose_fragment = old_instance_dispose_fragment;
+ instance_struct = old_instance_struct;
+ type_struct = old_type_struct;
+ instance_priv_struct = old_instance_priv_struct;
+ prop_enum = old_prop_enum;
+ instance_init_fragment = old_instance_init_fragment;
+ instance_dispose_fragment = old_instance_dispose_fragment;
}
private void add_class_init_function (Class! cl) {
if (m.base_method == null) {
continue;
}
- var base_type = m.base_method.symbol.parent_symbol.node;
+ var base_type = m.base_method.parent_symbol;
var ccast = new CCodeFunctionCall (new CCodeIdentifier ("%s_CLASS".printf (((Class) base_type).get_upper_case_cname (null))));
ccast.add_argument (new CCodeIdentifier ("klass"));
continue;
}
- var base_type = m.base_interface_method.symbol.parent_symbol.node;
+ var base_type = m.base_interface_method.parent_symbol;
if (base_type != iface) {
continue;
}
init_block.add_statement (instance_init_fragment);
- var init_sym = cl.symbol.lookup ("init");
+ var init_sym = cl.scope.lookup ("init");
if (init_sym != null) {
- var init_fun = (Method) init_sym.node;
+ var init_fun = (Method) init_sym;
init_block.add_statement (init_fun.body.ccodenode);
}
public class Vala.CodeGenerator {
public override void visit_interface (Interface! iface) {
- current_symbol = iface.symbol;
- current_type_symbol = iface.symbol;
+ current_symbol = iface;
+ current_type_symbol = iface;
if (!iface.is_static) {
type_struct = new CCodeStruct ("_%s".printf (iface.get_type_cname ()));
var ma = (MemberAccess) expr.call;
- if (expr.call.symbol_reference.node is Invokable) {
- var i = (Invokable) expr.call.symbol_reference.node;
+ if (expr.call.symbol_reference is Invokable) {
+ var i = (Invokable) expr.call.symbol_reference;
params = i.get_parameters ();
if (i is Method) {
}
if (m is ArrayResizeMethod) {
- var array = (Array) m.symbol.parent_symbol.node;
+ var array = (Array) m.parent_symbol;
ccall.add_argument (new CCodeIdentifier (array.get_cname ()));
}
if (ma.inner == null) {
instance = new CCodeIdentifier ("self");
/* require casts for overriden and inherited methods */
- req_cast = m.overrides || m.base_interface_method != null || (m.symbol.parent_symbol != current_type_symbol);
+ req_cast = m.overrides || m.base_interface_method != null || (m.parent_symbol != current_type_symbol);
} else {
instance = (CCodeExpression) ma.inner.ccodenode;
/* reqiure casts if the type of the used instance is
* different than the type which declared the method */
- req_cast = base_method.symbol.parent_symbol.node != ma.inner.static_type.data_type;
+ req_cast = base_method.parent_symbol != ma.inner.static_type.data_type;
}
- if (m.instance_by_reference && (ma.inner != null || m.symbol.parent_symbol != current_type_symbol)) {
+ if (m.instance_by_reference && (ma.inner != null || m.parent_symbol != current_type_symbol)) {
instance = new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, instance);
}
- if (req_cast && ((DataType) m.symbol.parent_symbol.node).is_reference_type ()) {
+ if (req_cast && ((DataType) m.parent_symbol).is_reference_type ()) {
// FIXME: use C cast if debugging disabled
- var ccall = new CCodeFunctionCall (new CCodeIdentifier (((DataType) base_method.symbol.parent_symbol.node).get_upper_case_cname (null)));
+ var ccall = new CCodeFunctionCall (new CCodeIdentifier (((DataType) base_method.parent_symbol).get_upper_case_cname (null)));
ccall.add_argument (instance);
instance = ccall;
}
public class Vala.CodeGenerator {
private void process_cmember (MemberAccess! expr, CCodeExpression pub_inst, DataType base_type) {
- if (expr.symbol_reference.node is Method) {
- var m = (Method) expr.symbol_reference.node;
+ if (expr.symbol_reference is Method) {
+ var m = (Method) expr.symbol_reference;
if (expr.inner is BaseAccess) {
if (m.base_interface_method != null) {
- var base_iface = (Interface) m.base_interface_method.symbol.parent_symbol.node;
+ var base_iface = (Interface) m.base_interface_method.parent_symbol;
string parent_iface_var = "%s_%s_parent_iface".printf (current_class.get_lower_case_cname (null), base_iface.get_lower_case_cname (null));
expr.ccodenode = new CCodeMemberAccess.pointer (new CCodeIdentifier (parent_iface_var), m.name);
return;
} else if (m.base_method != null) {
- var base_class = (Class) m.base_method.symbol.parent_symbol.node;
+ var base_class = (Class) m.base_method.parent_symbol;
var vcast = new CCodeFunctionCall (new CCodeIdentifier ("%s_CLASS".printf (base_class.get_upper_case_cname (null))));
vcast.add_argument (new CCodeIdentifier ("%s_parent_class".printf (current_class.get_lower_case_cname (null))));
} else {
expr.ccodenode = new CCodeIdentifier (m.get_cname ());
}
- } else if (expr.symbol_reference.node is ArrayLengthField) {
+ } else if (expr.symbol_reference is ArrayLengthField) {
expr.ccodenode = get_array_length_cexpression (expr.inner, 1);
- } else if (expr.symbol_reference.node is Field) {
- var f = (Field) expr.symbol_reference.node;
+ } else if (expr.symbol_reference is Field) {
+ var f = (Field) expr.symbol_reference;
if (f.instance) {
CCodeExpression typed_inst;
- if (f.symbol.parent_symbol.node != base_type) {
+ if (f.parent_symbol != base_type) {
// FIXME: use C cast if debugging disabled
- typed_inst = new CCodeFunctionCall (new CCodeIdentifier (((DataType) f.symbol.parent_symbol.node).get_upper_case_cname (null)));
+ typed_inst = new CCodeFunctionCall (new CCodeIdentifier (((DataType) f.parent_symbol).get_upper_case_cname (null)));
((CCodeFunctionCall) typed_inst).add_argument (pub_inst);
} else {
typed_inst = pub_inst;
} else {
inst = typed_inst;
}
- if (((DataType) f.symbol.parent_symbol.node).is_reference_type ()) {
+ if (((DataType) f.parent_symbol).is_reference_type ()) {
expr.ccodenode = new CCodeMemberAccess.pointer (inst, f.get_cname ());
} else {
expr.ccodenode = new CCodeMemberAccess (inst, f.get_cname ());
} else {
expr.ccodenode = new CCodeIdentifier (f.get_cname ());
}
- } else if (expr.symbol_reference.node is Constant) {
- var c = (Constant) expr.symbol_reference.node;
+ } else if (expr.symbol_reference is Constant) {
+ var c = (Constant) expr.symbol_reference;
expr.ccodenode = new CCodeIdentifier (c.get_cname ());
- } else if (expr.symbol_reference.node is Property) {
- var prop = (Property) expr.symbol_reference.node;
+ } else if (expr.symbol_reference is Property) {
+ var prop = (Property) expr.symbol_reference;
if (!prop.no_accessor_method) {
var base_property = prop;
} else if (prop.base_interface_property != null) {
base_property = prop.base_interface_property;
}
- var base_property_type = (DataType) base_property.symbol.parent_symbol.node;
+ var base_property_type = (DataType) base_property.parent_symbol;
var ccall = new CCodeFunctionCall (new CCodeIdentifier ("%s_get_%s".printf (base_property_type.get_lower_case_cname (null), base_property.name)));
CCodeExpression typed_pub_inst = pub_inst;
ccomma.append_expression (ctemp);
expr.ccodenode = ccomma;
}
- } else if (expr.symbol_reference.node is EnumValue) {
- var ev = (EnumValue) expr.symbol_reference.node;
+ } else if (expr.symbol_reference is EnumValue) {
+ var ev = (EnumValue) expr.symbol_reference;
expr.ccodenode = new CCodeConstant (ev.get_cname ());
- } else if (expr.symbol_reference.node is VariableDeclarator) {
- var decl = (VariableDeclarator) expr.symbol_reference.node;
+ } else if (expr.symbol_reference is VariableDeclarator) {
+ var decl = (VariableDeclarator) expr.symbol_reference;
expr.ccodenode = new CCodeIdentifier (get_variable_cname (decl.name));
- } else if (expr.symbol_reference.node is FormalParameter) {
- var p = (FormalParameter) expr.symbol_reference.node;
+ } else if (expr.symbol_reference is FormalParameter) {
+ var p = (FormalParameter) expr.symbol_reference;
if (p.name == "this") {
expr.ccodenode = pub_inst;
} else {
expr.ccodenode = new CCodeIdentifier (p.name);
}
}
- } else if (expr.symbol_reference.node is Signal) {
- var sig = (Signal) expr.symbol_reference.node;
- var cl = (DataType) sig.symbol.parent_symbol.node;
+ } else if (expr.symbol_reference is Signal) {
+ var sig = (Signal) expr.symbol_reference;
+ var cl = (DataType) sig.parent_symbol;
if (sig.has_emitter) {
var ccall = new CCodeFunctionCall (new CCodeIdentifier ("%s_%s".printf (cl.get_lower_case_cname (null), sig.name)));
if (current_type_symbol != null) {
/* base type is available if this is a type method */
- base_type = (DataType) current_type_symbol.node;
+ base_type = (DataType) current_type_symbol;
if (!base_type.is_reference_type ()) {
pub_inst = new CCodeIdentifier ("(*self)");
Method old_method = current_method;
TypeReference old_return_type = current_return_type;
bool old_method_inner_error = current_method_inner_error;
- current_symbol = m.symbol;
+ current_symbol = m;
current_method = m;
current_return_type = m.return_type;
current_method_inner_error = false;
m.accept_children (this);
if (m is CreationMethod) {
- if (current_class != null && m.body != null) {
+ if (current_type_symbol is Class && m.body != null) {
add_object_creation ((CCodeBlock) m.body.ccodenode);
}
current_return_type = old_return_type;
current_method_inner_error = old_method_inner_error;
- if (current_type_symbol != null && current_type_symbol.node is Interface) {
- var iface = (Interface) current_type_symbol.node;
+ if (current_type_symbol != null && current_type_symbol is Interface) {
+ var iface = (Interface) current_type_symbol;
if (iface.is_static) {
return;
}
this_type.data_type = find_parent_type (m);
if (m.base_interface_method != null) {
var base_type = new TypeReference ();
- base_type.data_type = (DataType) m.base_interface_method.symbol.parent_symbol.node;
+ base_type.data_type = (DataType) m.base_interface_method.parent_symbol;
instance_param = new CCodeFormalParameter ("base", base_type.get_cname ());
} else if (m.overrides) {
var base_type = new TypeReference ();
- base_type.data_type = (DataType) m.base_method.symbol.parent_symbol.node;
+ base_type.data_type = (DataType) m.base_method.parent_symbol;
instance_param = new CCodeFormalParameter ("base", base_type.get_cname ());
} else {
if (m.instance_by_reference) {
}
}
- if (m is CreationMethod && current_class != null) {
+ if (m is CreationMethod && current_type_symbol is Class) {
// memory management for generic types
foreach (TypeParameter type_param in current_class.get_type_parameters ()) {
var cparam = new CCodeFormalParameter ("%s_destroy_func".printf (type_param.name.down ()), "GDestroyNotify");
var cinit = new CCodeFragment ();
function.block.prepend_statement (cinit);
- if (m.symbol.parent_symbol.node is Class) {
- var cl = (Class) m.symbol.parent_symbol.node;
+ if (m.parent_symbol is Class) {
+ var cl = (Class) m.parent_symbol;
if (m.overrides || m.base_interface_method != null) {
var ccall = new CCodeFunctionCall (new CCodeIdentifier (cl.get_upper_case_cname (null)));
ccall.add_argument (new CCodeIdentifier ("base"));
source_type_member_definition.append (function);
if (m is CreationMethod) {
- if (current_class != null) {
+ if (current_type_symbol is Class) {
int n_params = ((CreationMethod) m).n_construction_params;
n_params += (int) current_class.get_type_parameters ().length ();
cinit.append (new CCodeExpressionStatement (ccomma));
}
} else {
- var st = (Struct) m.symbol.parent_symbol.node;
+ var st = (Struct) m.parent_symbol;
var cdecl = new CCodeDeclaration (st.get_cname () + "*");
var ccall = new CCodeFunctionCall (new CCodeIdentifier ("g_new0"));
ccall.add_argument (new CCodeConstant (st.get_cname ()));
var vfunc = new CCodeFunction (m.get_cname (), m.return_type.get_cname ());
var this_type = new TypeReference ();
- this_type.data_type = (DataType) m.symbol.parent_symbol.node;
+ this_type.data_type = (DataType) m.parent_symbol;
var cparam = new CCodeFormalParameter ("self", this_type.get_cname ());
vfunc.add_parameter (cparam);
var vblock = new CCodeBlock ();
CCodeFunctionCall vcast = null;
- if (m.symbol.parent_symbol.node is Interface) {
- var iface = (Interface) m.symbol.parent_symbol.node;
+ if (m.parent_symbol is Interface) {
+ var iface = (Interface) m.parent_symbol;
vcast = new CCodeFunctionCall (new CCodeIdentifier ("%s_GET_INTERFACE".printf (iface.get_upper_case_cname (null))));
} else {
- var cl = (Class) m.symbol.parent_symbol.node;
+ var cl = (Class) m.parent_symbol;
vcast = new CCodeFunctionCall (new CCodeIdentifier ("%s_GET_CLASS".printf (cl.get_upper_case_cname (null))));
}
return null;
}
- private DataType find_parent_type (CodeNode node) {
- var sym = node.symbol;
+ private DataType find_parent_type (Symbol sym) {
while (sym != null) {
- if (sym.node is DataType) {
- return (DataType) sym.node;
+ if (sym is DataType) {
+ return (DataType) sym;
}
sym = sym.parent_symbol;
}
}
} else if (t.data_type is Enum) {
return "gint";
- } else if (t.data_type is Flags) {
- return "guint";
} else if (t.data_type is Array) {
return "gpointer";
}
public class Vala.CodeGenerator {
public override void visit_struct (Struct! st) {
- current_type_symbol = st.symbol;
-
+ var old_type_symbol = current_type_symbol;
+ var old_instance_struct = instance_struct;
+ var old_instance_dispose_fragment = instance_dispose_fragment;
+ current_type_symbol = st;
instance_struct = new CCodeStruct ("_%s".printf (st.get_cname ()));
+ instance_dispose_fragment = null;
if (st.source_reference.file.cycle == null) {
header_type_declaration.append (new CCodeTypeDefinition ("struct _%s".printf (st.get_cname ()), new CCodeVariableDeclarator (st.get_cname ())));
st.accept_children (this);
- current_type_symbol = null;
+ current_type_symbol = old_type_symbol;
+ instance_struct = old_instance_struct;
+ instance_dispose_fragment = old_instance_dispose_fragment;
}
}
valafield.c \
valafield.h \
valafield.vala \
- valaflags.c \
- valaflags.h \
- valaflags.vala \
- valaflagsvalue.c \
- valaflagsvalue.h \
- valaflagsvalue.vala \
valaforeachstatement.c \
valaforeachstatement.h \
valaforeachstatement.vala \
valareturnstatement.c \
valareturnstatement.h \
valareturnstatement.vala \
+ valascope.c \
+ valascope.h \
+ valascope.vala \
valasemanticanalyzer.c \
valasemanticanalyzer.h \
valasemanticanalyzer.vala \
valaswitchstatement.c \
valaswitchstatement.h \
valaswitchstatement.vala \
- valasymbolbuilder.c \
- valasymbolbuilder.h \
- valasymbolbuilder.vala \
valasymbol.c \
valasymbol.h \
valasymbol.vala \
valaexpression.h \
valaexpressionstatement.h \
valafield.h \
- valaflags.h \
- valaflagsvalue.h \
valaforeachstatement.h \
valaformalparameter.h \
valaforstatement.h \
valareferencetransferexpression.h \
valareport.h \
valareturnstatement.h \
+ valascope.h \
valasemanticanalyzer.h \
valasignal.h \
valasizeofexpression.h \
valaswitchlabel.h \
valaswitchsection.h \
valaswitchstatement.h \
- valasymbolbuilder.h \
valasymbol.h \
valasymbolresolver.h \
valathrowstatement.h \
#define src_com(l,c) (vala_source_reference_new_with_comment (current_source_file, l.first_line, l.first_column, l.last_line, l.last_column, c))
static ValaSourceFile *current_source_file;
-static ValaNamespace *current_namespace;
-static gboolean current_namespace_implicit;
-static ValaClass *current_class;
-static ValaStruct *current_struct;
-static ValaInterface *current_interface;
-static ValaEnum *current_enum;
+static GList *symbol_stack;
+static GList *scope_stack;
typedef enum {
VALA_MODIFIER_NONE,
int yylex (YYSTYPE *yylval_param, YYLTYPE *yylloc_param, ValaParser *parser);
static void yyerror (YYLTYPE *locp, ValaParser *parser, const char *msg);
+
+static void push_symbol (ValaSymbol *symbol);
+static ValaSymbol *pop_symbol (void);
+
+static gboolean check_is_namespace (ValaSymbol *symbol, ValaSourceReference *src);
+static gboolean check_is_class (ValaSymbol *symbol, ValaSourceReference *src);
%}
%defines
ValaTypeReference *type_reference;
ValaExpression *expression;
ValaStatement *statement;
- ValaNamespace *namespace;
- ValaClass *class;
+ ValaBlock *block;
ValaStruct *struct_;
ValaInterface *interface;
- ValaEnum *enum_;
ValaEnumValue *enum_value;
- ValaFlags *flags;
- ValaFlagsValue *flags_value;
- ValaCallback *callback;
ValaConstant *constant;
ValaField *field;
ValaMethod *method;
%token ENUM "enum"
%token VALA_FALSE "false"
%token FINALLY "finally"
-%token FLAGS "flags"
%token FOR "for"
%token FOREACH "foreach"
%token GET "get"
%type <expression> opt_expression
%type <expression> expression
%type <statement> statement
-%type <statement> embedded_statement
-%type <statement> block
+%type <block> embedded_statement
+%type <block> block
%type <list> opt_statement_list
%type <list> statement_list
%type <statement> empty_statement
%type <catch_clause> specific_catch_clause
%type <catch_clause> opt_general_catch_clause
%type <catch_clause> general_catch_clause
-%type <statement> opt_finally_clause
-%type <statement> finally_clause
+%type <block> opt_finally_clause
+%type <block> finally_clause
%type <statement> lock_statement
-%type <namespace> namespace_declaration
%type <str> opt_name_specifier
%type <str> name_specifier
-%type <class> class_declaration
%type <num> opt_access_modifier
%type <num> access_modifier
%type <num> opt_modifiers
%type <property_accessor> get_accessor_declaration
%type <property_accessor> opt_set_accessor_declaration
%type <property_accessor> set_accessor_declaration
-%type <struct_> struct_declaration
%type <struct_> struct_header
-%type <interface> interface_declaration
-%type <enum_> enum_declaration
-%type <flags> flags_declaration
-%type <list> flags_body
-%type <list> opt_flags_member_declarations
-%type <list> flags_member_declarations
-%type <flags_value> flags_member_declaration
-%type <callback> callback_declaration
%type <constant> constant_declaration
%type <field> field_declaration
%type <list> variable_declarators
%type <expression> variable_initializer
%type <method> method_declaration
%type <method> method_header
-%type <statement> method_body
+%type <block> method_body
%type <list> opt_formal_parameter_list
%type <list> formal_parameter_list
%type <num> opt_construct
g_object_unref ($1);
g_object_unref ($3);
}
- /* don't use two OP_GT due to resolve parse conflicts
+ /* don't use two OP_GT to resolve parse conflicts
* stacked generics won't be that common in vala */
| shift_expression OP_SHIFT_RIGHT additive_expression
{
statement
: declaration_statement
| block
+ {
+ $$ = VALA_STATEMENT ($1);
+ }
| empty_statement
| expression_statement
| selection_statement
| empty_statement
{
ValaSourceReference *src = src(@1);
- $$ = VALA_STATEMENT (vala_block_new (src));
- vala_block_add_statement (VALA_BLOCK ($$), $1);
+ $$ = vala_block_new (src);
+ vala_block_add_statement ($$, $1);
g_object_unref ($1);
g_object_unref (src);
}
| expression_statement
{
ValaSourceReference *src = src(@1);
- $$ = VALA_STATEMENT (vala_block_new (src));
- vala_block_add_statement (VALA_BLOCK ($$), $1);
+ $$ = vala_block_new (src);
+ vala_block_add_statement ($$, $1);
g_object_unref ($1);
g_object_unref (src);
}
| selection_statement
{
ValaSourceReference *src = src(@1);
- $$ = VALA_STATEMENT (vala_block_new (src));
- vala_block_add_statement (VALA_BLOCK ($$), $1);
+ $$ = vala_block_new (src);
+ vala_block_add_statement ($$, $1);
g_object_unref ($1);
g_object_unref (src);
}
| iteration_statement
{
ValaSourceReference *src = src(@1);
- $$ = VALA_STATEMENT (vala_block_new (src));
- vala_block_add_statement (VALA_BLOCK ($$), $1);
+ $$ = vala_block_new (src);
+ vala_block_add_statement ($$, $1);
g_object_unref ($1);
g_object_unref (src);
}
| jump_statement
{
ValaSourceReference *src = src(@1);
- $$ = VALA_STATEMENT (vala_block_new (src));
- vala_block_add_statement (VALA_BLOCK ($$), $1);
+ $$ = vala_block_new (src);
+ vala_block_add_statement ($$, $1);
g_object_unref ($1);
g_object_unref (src);
}
| try_statement
{
ValaSourceReference *src = src(@1);
- $$ = VALA_STATEMENT (vala_block_new (src));
- vala_block_add_statement (VALA_BLOCK ($$), $1);
+ $$ = vala_block_new (src);
+ vala_block_add_statement ($$, $1);
g_object_unref ($1);
g_object_unref (src);
}
| lock_statement
{
ValaSourceReference *src = src(@1);
- $$ = VALA_STATEMENT (vala_block_new (src));
- vala_block_add_statement (VALA_BLOCK ($$), $1);
+ $$ = vala_block_new (src);
+ vala_block_add_statement ($$, $1);
g_object_unref ($1);
g_object_unref (src);
}
: OPEN_BRACE opt_statement_list CLOSE_BRACE
{
ValaSourceReference *src = src(@1);
- $$ = VALA_STATEMENT (vala_block_new (src));
+ $$ = vala_block_new (src);
if ($2 != NULL) {
GList *l;
for (l = $2; l != NULL; l = l->next) {
- vala_block_add_statement (VALA_BLOCK ($$), l->data);
+ vala_block_add_statement ($$, l->data);
g_object_unref (l->data);
}
g_list_free ($2);
if_statement
: comment IF open_parens expression CLOSE_PARENS embedded_statement
{
- ValaBlock *true_block;
ValaSourceReference *src;
- if (VALA_IS_BLOCK ($6)) {
- true_block = VALA_BLOCK ($6);
- } else {
- true_block = vala_block_new (vala_code_node_get_source_reference (VALA_CODE_NODE ($6)));
- vala_block_add_statement (true_block, $6);
- g_object_unref ($6);
- }
-
src = src_com(@4, $1);
- $$ = VALA_STATEMENT (vala_if_statement_new ($4, true_block, NULL, src));
+ $$ = VALA_STATEMENT (vala_if_statement_new ($4, $6, NULL, src));
g_object_unref (src);
g_object_unref ($4);
- g_object_unref (true_block);
+ g_object_unref ($6);
}
| comment IF open_parens expression CLOSE_PARENS embedded_statement ELSE embedded_statement
{
- ValaBlock *true_block;
- ValaBlock *false_block;
ValaSourceReference *src;
- if (VALA_IS_BLOCK ($6)) {
- true_block = VALA_BLOCK ($6);
- } else {
- true_block = vala_block_new (vala_code_node_get_source_reference (VALA_CODE_NODE ($6)));
- vala_block_add_statement (true_block, $6);
- g_object_unref ($6);
- }
-
- if (VALA_IS_BLOCK ($8)) {
- false_block = VALA_BLOCK ($8);
- } else {
- false_block = vala_block_new (vala_code_node_get_source_reference (VALA_CODE_NODE ($8)));
- vala_block_add_statement (false_block, $8);
- g_object_unref ($8);
- }
-
src = src_com(@4, $1);
- $$ = VALA_STATEMENT (vala_if_statement_new ($4, true_block, false_block, src));
+ $$ = VALA_STATEMENT (vala_if_statement_new ($4, $6, $8, src));
g_object_unref (src);
g_object_unref ($4);
- g_object_unref (true_block);
- g_object_unref (false_block);
+ g_object_unref ($6);
+ g_object_unref ($8);
}
;
if (init != NULL) {
ValaSourceReference *decl_src = vala_code_node_get_source_reference (VALA_CODE_NODE (decl));
- ValaMemberAccess *lhs = vala_member_access_new (NULL, vala_variable_declarator_get_name (decl), decl_src);
+ ValaMemberAccess *lhs = vala_member_access_new (NULL, vala_symbol_get_name (VALA_SYMBOL (decl)), decl_src);
ValaAssignment *assign = vala_assignment_new (VALA_EXPRESSION (lhs), init, VALA_ASSIGNMENT_OPERATOR_SIMPLE, decl_src);
g_object_unref (lhs);
vala_for_statement_add_initializer (for_statement, VALA_EXPRESSION (assign));
{
GList *l;
ValaSourceReference *src = src(@1);
- $$ = VALA_STATEMENT (vala_try_statement_new (VALA_BLOCK ($2), VALA_BLOCK ($4), src));
+ $$ = VALA_STATEMENT (vala_try_statement_new ($2, $4, src));
g_object_unref ($2);
if ($4 != NULL) {
g_object_unref ($4);
| TRY block finally_clause
{
ValaSourceReference *src = src(@1);
- $$ = VALA_STATEMENT (vala_try_statement_new (VALA_BLOCK ($2), VALA_BLOCK ($3), src));
+ $$ = VALA_STATEMENT (vala_try_statement_new ($2, $3, src));
g_object_unref ($2);
g_object_unref ($3);
g_object_unref (src);
: comment opt_attributes NAMESPACE identifier
{
ValaSourceReference *src = src_com(@4, $1);
- current_namespace = vala_namespace_new ($4, src);
+ ValaSymbol *current_symbol = vala_scope_lookup (scope_stack->data, $4);
+ if (current_symbol != NULL) {
+ if (check_is_namespace (current_symbol, src)) {
+ // merge namespace declarations
+ if (!vala_source_file_get_pkg (current_source_file)) {
+ vala_namespace_set_pkg (VALA_NAMESPACE (current_symbol), FALSE);
+ }
+ VALA_CODE_NODE (current_symbol)->attributes = $2;
+ }
+ } else {
+ current_symbol = VALA_SYMBOL (vala_namespace_new ($4, src));
+ vala_namespace_set_pkg (VALA_NAMESPACE (current_symbol), vala_source_file_get_pkg (current_source_file));
+ VALA_CODE_NODE (current_symbol)->attributes = g_list_concat (VALA_CODE_NODE (current_symbol)->attributes, $2);
+ vala_namespace_add_namespace (VALA_NAMESPACE (symbol_stack->data), VALA_NAMESPACE (current_symbol));
+ }
g_object_unref (src);
- VALA_CODE_NODE(current_namespace)->attributes = $2;
g_free ($4);
+
+ push_symbol (current_symbol);
}
namespace_body
{
- $$ = current_namespace;
- current_namespace = vala_code_context_get_global_namespace (vala_source_file_get_context (current_source_file));
+ g_object_unref (pop_symbol ());
}
;
outer_declaration
: namespace_declaration
- {
- vala_code_context_add_namespace (vala_source_file_get_context (current_source_file), $1);
- g_object_unref ($1);
- }
| namespace_member_declaration
;
namespace_member_declaration
: class_declaration
- {
- /* skip declarations with errors */
- if ($1 != NULL) {
- vala_namespace_add_class (current_namespace, $1);
- vala_source_file_add_node (current_source_file, VALA_CODE_NODE ($1));
- g_object_unref ($1);
- }
-
- if (current_namespace_implicit) {
- /* current namespace has been declared implicitly */
- current_namespace = vala_code_context_get_global_namespace (vala_source_file_get_context (current_source_file));
- current_namespace_implicit = FALSE;
- }
- }
| struct_declaration
- {
- /* skip declarations with errors */
- if ($1 != NULL) {
- vala_namespace_add_struct (current_namespace, $1);
- vala_source_file_add_node (current_source_file, VALA_CODE_NODE ($1));
- g_object_unref ($1);
- }
-
- if (current_namespace_implicit) {
- /* current namespace has been declared implicitly */
- current_namespace = vala_code_context_get_global_namespace (vala_source_file_get_context (current_source_file));
- current_namespace_implicit = FALSE;
- }
- }
| interface_declaration
- {
- /* skip declarations with errors */
- if ($1 != NULL) {
- vala_namespace_add_interface (current_namespace, $1);
- vala_source_file_add_node (current_source_file, VALA_CODE_NODE ($1));
- g_object_unref ($1);
- }
-
- if (current_namespace_implicit) {
- /* current namespace has been declared implicitly */
- current_namespace = vala_code_context_get_global_namespace (vala_source_file_get_context (current_source_file));
- current_namespace_implicit = FALSE;
- }
- }
| enum_declaration
- {
- /* skip declarations with errors */
- if ($1 != NULL) {
- vala_namespace_add_enum (current_namespace, $1);
- vala_source_file_add_node (current_source_file, VALA_CODE_NODE ($1));
- g_object_unref ($1);
- }
-
- if (current_namespace_implicit) {
- /* current namespace has been declared implicitly */
- current_namespace = vala_code_context_get_global_namespace (vala_source_file_get_context (current_source_file));
- current_namespace_implicit = FALSE;
- }
- }
- | flags_declaration
- {
- /* skip declarations with errors */
- if ($1 != NULL) {
- vala_namespace_add_flags (current_namespace, $1);
- vala_source_file_add_node (current_source_file, VALA_CODE_NODE ($1));
- g_object_unref ($1);
- }
-
- if (current_namespace_implicit) {
- /* current namespace has been declared implicitly */
- current_namespace = vala_code_context_get_global_namespace (vala_source_file_get_context (current_source_file));
- current_namespace_implicit = FALSE;
- }
- }
| callback_declaration
- {
- /* skip declarations with errors */
- if ($1 != NULL) {
- vala_namespace_add_callback (current_namespace, $1);
- vala_source_file_add_node (current_source_file, VALA_CODE_NODE ($1));
- g_object_unref ($1);
- }
-
- if (current_namespace_implicit) {
- /* current namespace has been declared implicitly */
- current_namespace = vala_code_context_get_global_namespace (vala_source_file_get_context (current_source_file));
- current_namespace_implicit = FALSE;
- }
- }
| constant_declaration
{
/* skip declarations with errors */
if ($1 != NULL) {
- vala_namespace_add_constant (current_namespace, $1);
+ vala_namespace_add_constant (VALA_NAMESPACE (symbol_stack->data), $1);
vala_source_file_add_node (current_source_file, VALA_CODE_NODE ($1));
g_object_unref ($1);
}
* to explicitly state it */
vala_field_set_instance ($1, FALSE);
- vala_namespace_add_field (current_namespace, $1);
+ vala_namespace_add_field (VALA_NAMESPACE (symbol_stack->data), $1);
vala_source_file_add_node (current_source_file, VALA_CODE_NODE ($1));
g_object_unref ($1);
}
* to explicitly state it */
vala_method_set_instance ($1, FALSE);
- vala_namespace_add_method (current_namespace, $1);
+ vala_namespace_add_method (VALA_NAMESPACE (symbol_stack->data), $1);
vala_source_file_add_node (current_source_file, VALA_CODE_NODE ($1));
g_object_unref ($1);
}
ValaSourceReference *src;
char *name = $6;
-
+
+ ValaSymbol *parent_symbol = VALA_SYMBOL (g_object_ref (symbol_stack->data));
+ ValaScope *parent_scope = VALA_SCOPE (scope_stack->data);
+
if ($7 != NULL) {
ValaSourceReference *ns_src = src(@6);
- current_namespace = vala_namespace_new ($6, ns_src);
+ parent_symbol = vala_scope_lookup (parent_scope, $6);
+ if (parent_symbol != NULL) {
+ if (check_is_namespace (parent_symbol, src)) {
+ if (!vala_source_file_get_pkg (current_source_file)) {
+ vala_namespace_set_pkg (VALA_NAMESPACE (parent_symbol), FALSE);
+ }
+ }
+ } else {
+ parent_symbol = VALA_SYMBOL (vala_namespace_new ($6, ns_src));
+ vala_namespace_set_pkg (VALA_NAMESPACE (parent_symbol), vala_source_file_get_pkg (current_source_file));
+ vala_namespace_add_namespace (VALA_NAMESPACE (symbol_stack->data), VALA_NAMESPACE (parent_symbol));
+ }
+ parent_scope = vala_symbol_get_scope (parent_symbol);
g_free ($6);
g_object_unref (ns_src);
- current_namespace_implicit = TRUE;
-
- vala_code_context_add_namespace (vala_source_file_get_context (current_source_file), current_namespace);
- g_object_unref (current_namespace);
name = $7;
}
-
+
src = src_com(@6, $1);
- current_class = vala_class_new (name, src);
- g_free (name);
- g_object_unref (src);
-
- VALA_CODE_NODE(current_class)->attributes = $2;
- if ($3 != 0) {
- VALA_DATA_TYPE(current_class)->access = $3;
- }
- if (($4 & VALA_MODIFIER_ABSTRACT) == VALA_MODIFIER_ABSTRACT) {
- vala_class_set_is_abstract (current_class, TRUE);
- }
- if (($4 & VALA_MODIFIER_STATIC) == VALA_MODIFIER_STATIC) {
- vala_class_set_is_static (current_class, TRUE);
- }
- if ($8 != NULL) {
- for (l = $8; l != NULL; l = l->next) {
- vala_class_add_type_parameter (current_class, l->data);
- g_object_unref (l->data);
+ ValaSymbol *current_symbol = vala_scope_lookup (parent_scope, name);
+ if (current_symbol != NULL) {
+ if (check_is_class (current_symbol, src)) {
+ // merge class declarations
}
- g_list_free ($8);
- }
- if ($9 != NULL) {
- for (l = $9; l != NULL; l = l->next) {
- vala_class_add_base_type (current_class, l->data);
- g_object_unref (l->data);
+ } else {
+ current_symbol = VALA_SYMBOL (vala_class_new (name, src));
+ g_free (name);
+ g_object_unref (src);
+
+ if (VALA_IS_CLASS (parent_symbol)) {
+ vala_class_add_class (VALA_CLASS (parent_symbol), VALA_CLASS (current_symbol));
+ } else if (VALA_IS_NAMESPACE (parent_symbol)) {
+ vala_namespace_add_class (VALA_NAMESPACE (parent_symbol), VALA_CLASS (current_symbol));
+ vala_source_file_add_node (current_source_file, VALA_CODE_NODE (current_symbol));
+ } else {
+ g_assert_not_reached ();
+ }
+
+ VALA_CODE_NODE (current_symbol)->attributes = $2;
+ if ($3 != 0) {
+ VALA_DATA_TYPE (current_symbol)->access = $3;
+ }
+ if (($4 & VALA_MODIFIER_ABSTRACT) == VALA_MODIFIER_ABSTRACT) {
+ vala_class_set_is_abstract (VALA_CLASS (current_symbol), TRUE);
+ }
+ if (($4 & VALA_MODIFIER_STATIC) == VALA_MODIFIER_STATIC) {
+ vala_class_set_is_static (VALA_CLASS (current_symbol), TRUE);
+ }
+ if ($8 != NULL) {
+ for (l = $8; l != NULL; l = l->next) {
+ vala_class_add_type_parameter (VALA_CLASS (current_symbol), l->data);
+ g_object_unref (l->data);
+ }
+ g_list_free ($8);
+ }
+ if ($9 != NULL) {
+ for (l = $9; l != NULL; l = l->next) {
+ vala_class_add_base_type (VALA_CLASS (current_symbol), l->data);
+ g_object_unref (l->data);
+ }
+ g_list_free ($9);
}
- g_list_free ($9);
}
+
+ g_object_unref (parent_symbol);
+
+ push_symbol (current_symbol);
}
class_body
{
- $$ = current_class;
- current_class = NULL;
+ g_object_unref (pop_symbol ());
}
;
{
/* skip declarations with errors */
if ($1 != NULL) {
- vala_class_add_constant (current_class, $1);
+ vala_class_add_constant (VALA_CLASS (symbol_stack->data), $1);
g_object_unref ($1);
}
}
{
/* skip declarations with errors */
if ($1 != NULL) {
- vala_class_add_field (current_class, $1);
+ vala_class_add_field (VALA_CLASS (symbol_stack->data), $1);
g_object_unref ($1);
}
}
{
/* skip declarations with errors */
if ($1 != NULL) {
- vala_class_add_method (current_class, $1);
+ vala_class_add_method (VALA_CLASS (symbol_stack->data), $1);
g_object_unref ($1);
}
}
{
/* skip declarations with errors */
if ($1 != NULL) {
- vala_class_add_property (current_class, $1, FALSE);
+ vala_class_add_property (VALA_CLASS (symbol_stack->data), $1, FALSE);
g_object_unref ($1);
}
}
{
/* skip declarations with errors */
if ($1 != NULL) {
- vala_class_add_signal (current_class, $1);
+ vala_class_add_signal (VALA_CLASS (symbol_stack->data), $1);
g_object_unref ($1);
}
}
{
/* skip declarations with errors */
if ($1 != NULL) {
- vala_class_set_constructor (current_class, $1);
+ vala_class_set_constructor (VALA_CLASS (symbol_stack->data), $1);
g_object_unref ($1);
}
}
{
/* skip declarations with errors */
if ($1 != NULL) {
- vala_class_set_destructor (current_class, $1);
+ vala_class_set_destructor (VALA_CLASS (symbol_stack->data), $1);
g_object_unref ($1);
}
}
+ | class_declaration
+ | struct_declaration
;
constant_declaration
: comment opt_attributes opt_access_modifier CONST type variable_declarator SEMICOLON
{
ValaSourceReference *src = src_com(@5, $1);
- $$ = vala_constant_new (vala_variable_declarator_get_name ($6), $5, vala_variable_declarator_get_initializer ($6), src);
+ $$ = vala_constant_new (vala_symbol_get_name (VALA_SYMBOL ($6)), $5, vala_variable_declarator_get_initializer ($6), src);
g_object_unref (src);
g_object_unref ($5);
g_object_unref ($6);
vala_type_reference_set_takes_ownership ($5, TRUE);
}
- $$ = vala_field_new (vala_variable_declarator_get_name ($6), $5, vala_variable_declarator_get_initializer ($6), src);
+ $$ = vala_field_new (vala_symbol_get_name (VALA_SYMBOL ($6)), $5, vala_variable_declarator_get_initializer ($6), src);
g_object_unref (src);
if ($3 != 0) {
$$->access = $3;
: method_header method_body
{
$$ = $1;
- vala_method_set_body ($$, VALA_BLOCK($2));
+ vala_method_set_body ($$, $2);
if ($2 != NULL) {
g_object_unref ($2);
}
struct_declaration
: struct_header
{
- current_struct = $1;
+ push_symbol (VALA_SYMBOL ($1));
}
struct_body
{
- $$ = current_struct;
- current_struct = NULL;
+ g_object_unref (pop_symbol ());
}
;
char *name = $5;
+ ValaSymbol *parent_symbol = VALA_SYMBOL (g_object_ref (symbol_stack->data));
+ ValaScope *parent_scope = VALA_SCOPE (scope_stack->data);
+
if ($6 != NULL) {
ValaSourceReference *ns_src = src(@5);
- current_namespace = vala_namespace_new ($5, ns_src);
+ parent_symbol = vala_scope_lookup (parent_scope, $5);
+ if (parent_symbol != NULL) {
+ if (check_is_namespace (parent_symbol, src)) {
+ if (!vala_source_file_get_pkg (current_source_file)) {
+ vala_namespace_set_pkg (VALA_NAMESPACE (parent_symbol), FALSE);
+ }
+ }
+ } else {
+ parent_symbol = VALA_SYMBOL (vala_namespace_new ($5, ns_src));
+ vala_namespace_set_pkg (VALA_NAMESPACE (parent_symbol), vala_source_file_get_pkg (current_source_file));
+ vala_namespace_add_namespace (VALA_NAMESPACE (symbol_stack->data), VALA_NAMESPACE (parent_symbol));
+ }
+ parent_scope = vala_symbol_get_scope (parent_symbol);
g_free ($5);
g_object_unref (ns_src);
- current_namespace_implicit = TRUE;
-
- vala_code_context_add_namespace (vala_source_file_get_context (current_source_file), current_namespace);
- g_object_unref (current_namespace);
name = $6;
}
$$ = vala_struct_new (name, src);
g_free (name);
g_object_unref (src);
+
+ if (VALA_IS_CLASS (parent_symbol)) {
+ vala_class_add_struct (VALA_CLASS (parent_symbol), $$);
+ } else if (VALA_IS_NAMESPACE (parent_symbol)) {
+ vala_namespace_add_struct (VALA_NAMESPACE (parent_symbol), $$);
+ vala_source_file_add_node (current_source_file, VALA_CODE_NODE ($$));
+ } else {
+ g_assert_not_reached ();
+ }
+
for (l = $7; l != NULL; l = l->next) {
vala_struct_add_type_parameter ($$, l->data);
}
{
/* skip declarations with errors */
if ($1 != NULL) {
- vala_struct_add_field (current_struct, $1);
+ vala_struct_add_field (VALA_STRUCT (symbol_stack->data), $1);
g_object_unref ($1);
}
}
{
/* skip declarations with errors */
if ($1 != NULL) {
- vala_struct_add_method (current_struct, $1);
+ vala_struct_add_method (VALA_STRUCT (symbol_stack->data), $1);
g_object_unref ($1);
}
}
ValaSourceReference *src;
char *name = $6;
+ ValaSymbol *parent_symbol = VALA_SYMBOL (g_object_ref (symbol_stack->data));
+ ValaScope *parent_scope = VALA_SCOPE (scope_stack->data);
+
if ($7 != NULL) {
ValaSourceReference *ns_src = src(@6);
- current_namespace = vala_namespace_new ($6, ns_src);
+ parent_symbol = vala_scope_lookup (parent_scope, $6);
+ if (parent_symbol != NULL) {
+ if (check_is_namespace (parent_symbol, src)) {
+ if (!vala_source_file_get_pkg (current_source_file)) {
+ vala_namespace_set_pkg (VALA_NAMESPACE (parent_symbol), FALSE);
+ }
+ }
+ } else {
+ parent_symbol = VALA_SYMBOL (vala_namespace_new ($6, ns_src));
+ vala_namespace_set_pkg (VALA_NAMESPACE (parent_symbol), vala_source_file_get_pkg (current_source_file));
+ vala_namespace_add_namespace (VALA_NAMESPACE (symbol_stack->data), VALA_NAMESPACE (parent_symbol));
+ }
+ parent_scope = vala_symbol_get_scope (parent_symbol);
g_free ($6);
g_object_unref (ns_src);
- current_namespace_implicit = TRUE;
-
- vala_code_context_add_namespace (vala_source_file_get_context (current_source_file), current_namespace);
- g_object_unref (current_namespace);
name = $7;
}
src = src_com(@6, $1);
- current_interface = vala_interface_new (name, src);
+ ValaInterface *iface = vala_interface_new (name, src);
g_free (name);
g_object_unref (src);
- VALA_CODE_NODE(current_interface)->attributes = $2;
+ vala_namespace_add_interface (VALA_NAMESPACE (parent_symbol), iface);
+ vala_source_file_add_node (current_source_file, VALA_CODE_NODE (iface));
+ g_object_unref (parent_symbol);
+
+ VALA_CODE_NODE (iface)->attributes = $2;
if ($3 != 0) {
- VALA_DATA_TYPE(current_interface)->access = $3;
+ VALA_DATA_TYPE (iface)->access = $3;
}
if (($4 & VALA_MODIFIER_STATIC) == VALA_MODIFIER_STATIC) {
- vala_interface_set_is_static (current_interface, TRUE);
+ vala_interface_set_is_static (iface, TRUE);
}
if ($8 != NULL) {
GList *l;
for (l = $8; l != NULL; l = l->next) {
- vala_interface_add_type_parameter (current_interface, l->data);
+ vala_interface_add_type_parameter (iface, l->data);
g_object_unref (l->data);
}
g_list_free ($8);
if ($9 != NULL) {
GList *l;
for (l = $9; l != NULL; l = l->next) {
- vala_interface_add_prerequisite (current_interface, l->data);
+ vala_interface_add_prerequisite (iface, l->data);
g_object_unref (l->data);
}
g_list_free ($9);
}
+
+ push_symbol (VALA_SYMBOL (iface));
}
interface_body
{
- $$ = current_interface;
+ g_object_unref (pop_symbol ());
}
;
{
/* skip declarations with errors */
if ($1 != NULL) {
- vala_interface_add_method (current_interface, $1);
+ vala_interface_add_method (VALA_INTERFACE (symbol_stack->data), $1);
g_object_unref ($1);
}
}
{
/* skip declarations with errors */
if ($1 != NULL) {
- vala_interface_add_property (current_interface, $1);
+ vala_interface_add_property (VALA_INTERFACE (symbol_stack->data), $1);
g_object_unref ($1);
}
}
{
/* skip declarations with errors */
if ($1 != NULL) {
- vala_interface_add_signal (current_interface, $1);
+ vala_interface_add_signal (VALA_INTERFACE (symbol_stack->data), $1);
g_object_unref ($1);
}
}
char *name = $5;
+ ValaSymbol *parent_symbol = VALA_SYMBOL (g_object_ref (symbol_stack->data));
+ ValaScope *parent_scope = VALA_SCOPE (scope_stack->data);
+
if ($6 != NULL) {
ValaSourceReference *ns_src = src(@5);
- current_namespace = vala_namespace_new ($5, ns_src);
+ parent_symbol = vala_scope_lookup (parent_scope, $5);
+ if (parent_symbol != NULL) {
+ if (check_is_namespace (parent_symbol, src)) {
+ if (!vala_source_file_get_pkg (current_source_file)) {
+ vala_namespace_set_pkg (VALA_NAMESPACE (parent_symbol), FALSE);
+ }
+ }
+ } else {
+ parent_symbol = VALA_SYMBOL (vala_namespace_new ($5, ns_src));
+ vala_namespace_set_pkg (VALA_NAMESPACE (parent_symbol), vala_source_file_get_pkg (current_source_file));
+ vala_namespace_add_namespace (VALA_NAMESPACE (symbol_stack->data), VALA_NAMESPACE (parent_symbol));
+ }
+ parent_scope = vala_symbol_get_scope (parent_symbol);
g_free ($5);
g_object_unref (ns_src);
- current_namespace_implicit = TRUE;
-
- vala_code_context_add_namespace (vala_source_file_get_context (current_source_file), current_namespace);
- g_object_unref (current_namespace);
name = $6;
}
src = src_com(@5, $1);
- current_enum = vala_enum_new (name, src);
+ ValaEnum *en = vala_enum_new (name, src);
g_free (name);
g_object_unref (src);
- VALA_CODE_NODE(current_enum)->attributes = $2;
+ vala_namespace_add_enum (VALA_NAMESPACE (parent_symbol), en);
+ vala_source_file_add_node (current_source_file, VALA_CODE_NODE (en));
+ g_object_unref (parent_symbol);
+
+ VALA_CODE_NODE (en)->attributes = $2;
if ($3 != 0) {
- VALA_DATA_TYPE(current_enum)->access = $3;
+ VALA_DATA_TYPE (en)->access = $3;
}
+
+ push_symbol (VALA_SYMBOL (en));
}
enum_body
{
- $$ = current_enum;
- current_enum = NULL;
+ g_object_unref (pop_symbol ());
}
;
{
ValaEnumValue *ev = vala_enum_value_new ($2);
g_free ($2);
- vala_enum_add_value (current_enum, ev);
+ vala_enum_add_value (VALA_ENUM (symbol_stack->data), ev);
g_object_unref (ev);
}
| opt_attributes identifier ASSIGN expression
ValaEnumValue *ev = vala_enum_value_new_with_value ($2, $4);
g_free ($2);
g_object_unref ($4);
- vala_enum_add_value (current_enum, ev);
+ vala_enum_add_value (VALA_ENUM (symbol_stack->data), ev);
g_object_unref (ev);
}
;
{
/* skip declarations with errors */
if ($1 != NULL) {
- vala_enum_add_method (current_enum, $1);
+ vala_enum_add_method (VALA_ENUM (symbol_stack->data), $1);
g_object_unref ($1);
}
}
;
-flags_declaration
- : comment opt_attributes opt_access_modifier FLAGS identifier opt_name_specifier flags_body
- {
- GList *l;
- ValaSourceReference *src;
-
- char *name = $5;
-
- if ($6 != NULL) {
- ValaSourceReference *ns_src = src(@5);
- current_namespace = vala_namespace_new ($5, ns_src);
- g_free ($5);
- g_object_unref (ns_src);
- current_namespace_implicit = TRUE;
-
- vala_code_context_add_namespace (vala_source_file_get_context (current_source_file), current_namespace);
- g_object_unref (current_namespace);
-
- name = $6;
- }
-
- src = src_com(@5, $1);
- $$ = vala_flags_new (name, src);
- g_free (name);
- g_object_unref (src);
-
- VALA_CODE_NODE($$)->attributes = $2;
-
- if ($3 != 0) {
- VALA_DATA_TYPE($$)->access = $3;
- }
- for (l = $7; l != NULL; l = l->next) {
- vala_flags_add_value ($$, l->data);
- g_object_unref (l->data);
- }
- }
- ;
-
-flags_body
- : OPEN_BRACE opt_flags_member_declarations CLOSE_BRACE
- {
- $$ = $2;
- }
- ;
-
-opt_flags_member_declarations
- : /* empty */
- {
- $$ = NULL;
- }
- | flags_member_declarations opt_comma
- ;
-
-flags_member_declarations
- : flags_member_declaration
- {
- $$ = g_list_append (NULL, $1);
- }
- | flags_member_declarations COMMA flags_member_declaration
- {
- $$ = g_list_append ($1, $3);
- }
- ;
-
-flags_member_declaration
- : opt_attributes identifier
- {
- $$ = vala_flags_value_new ($2);
- g_free ($2);
- }
- | opt_attributes identifier ASSIGN expression
- {
- $$ = vala_flags_value_new_with_value ($2, $4);
- g_free ($2);
- g_object_unref ($4);
- }
- ;
-
callback_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
{
GList *l;
char *name = $7;
+ ValaSymbol *parent_symbol = VALA_SYMBOL (g_object_ref (symbol_stack->data));
+ ValaScope *parent_scope = VALA_SCOPE (scope_stack->data);
+
if ($8 != NULL) {
ValaSourceReference *ns_src = src(@7);
- current_namespace = vala_namespace_new ($7, ns_src);
+ parent_symbol = vala_scope_lookup (parent_scope, $7);
+ if (parent_symbol != NULL) {
+ if (check_is_namespace (parent_symbol, src)) {
+ if (!vala_source_file_get_pkg (current_source_file)) {
+ vala_namespace_set_pkg (VALA_NAMESPACE (parent_symbol), FALSE);
+ }
+ }
+ } else {
+ parent_symbol = VALA_SYMBOL (vala_namespace_new ($7, ns_src));
+ vala_namespace_set_pkg (VALA_NAMESPACE (parent_symbol), vala_source_file_get_pkg (current_source_file));
+ vala_namespace_add_namespace (VALA_NAMESPACE (symbol_stack->data), VALA_NAMESPACE (parent_symbol));
+ }
+ parent_scope = vala_symbol_get_scope (parent_symbol);
g_free ($7);
g_object_unref (ns_src);
- current_namespace_implicit = TRUE;
-
- vala_code_context_add_namespace (vala_source_file_get_context (current_source_file), current_namespace);
- g_object_unref (current_namespace);
name = $8;
}
src = src_com(@7, $1);
- $$ = vala_callback_new (name, $6, src);
+ ValaCallback *cb = vala_callback_new (name, $6, src);
g_free (name);
g_object_unref ($6);
g_object_unref (src);
+
+ vala_namespace_add_callback (VALA_NAMESPACE (parent_symbol), cb);
+ vala_source_file_add_node (current_source_file, VALA_CODE_NODE (cb));
+ g_object_unref (parent_symbol);
+
if ($3 != 0) {
- VALA_DATA_TYPE($$)->access = $3;
+ VALA_DATA_TYPE (cb)->access = $3;
}
- VALA_CODE_NODE($$)->attributes = $2;
+ VALA_CODE_NODE (cb)->attributes = $2;
if ($9 != NULL) {
for (l = $9; l != NULL; l = l->next) {
- vala_callback_add_type_parameter ($$, l->data);
+ vala_callback_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 ($$, l->data);
+ vala_callback_add_parameter (cb, l->data);
g_object_unref (l->data);
}
g_list_free ($11);
}
+
+ g_object_unref (cb);
}
;
vala_parser_parse_file (ValaParser *parser, ValaSourceFile *source_file)
{
current_source_file = source_file;
- current_namespace = vala_code_context_get_global_namespace (vala_source_file_get_context (current_source_file));
+ push_symbol (VALA_SYMBOL (vala_code_context_get_root (vala_source_file_get_context (source_file))));
yyin = fopen (vala_source_file_get_filename (current_source_file), "r");
if (yyin == NULL) {
printf ("Couldn't open source file: %s.\n", vala_source_file_get_filename (current_source_file));
fclose (yyin);
yyin = NULL;
}
+
+static void push_symbol (ValaSymbol *symbol) {
+ symbol_stack = g_list_prepend (symbol_stack, symbol);
+ scope_stack = g_list_prepend (scope_stack, vala_symbol_get_scope (symbol));
+}
+
+static ValaSymbol *pop_symbol (void) {
+ ValaSymbol *sym = VALA_SYMBOL (symbol_stack->data);
+ symbol_stack = g_list_delete_link (symbol_stack, symbol_stack);
+ scope_stack = g_list_delete_link (scope_stack, scope_stack);
+ return sym;
+}
+
+static gboolean check_is_namespace (ValaSymbol *symbol, ValaSourceReference *src) {
+ if (!VALA_IS_NAMESPACE (symbol)) {
+ char *sym_name = vala_symbol_get_full_name (symbol);
+ char *error_msg = g_strdup_printf ("`%s` already exists but is not a namespace", sym_name);
+ g_free (sym_name);
+ vala_report_error (src, error_msg);
+ g_free (error_msg);
+ return FALSE;
+ }
+ return TRUE;
+}
+
+static gboolean check_is_class (ValaSymbol *symbol, ValaSourceReference *src) {
+ if (!VALA_IS_CLASS (symbol)) {
+ char *sym_name = vala_symbol_get_full_name (symbol);
+ char *error_msg = g_strdup_printf ("`%s` already exists but is not a class", sym_name);
+ g_free (sym_name);
+ vala_report_error (src, error_msg);
+ g_free (error_msg);
+ return FALSE;
+ }
+ return TRUE;
+}
+
"enum" { uploc; return ENUM; }
"false" { uploc; return VALA_FALSE; }
"finally" { uploc; return FINALLY; }
-"flags" { uploc; return FLAGS; }
"for" { uploc; return FOR; }
"foreach" { uploc; return FOREACH; }
"get" { uploc; return GET; }
#include <vala/valaexpression.h>
#include <vala/valaexpressionstatement.h>
#include <vala/valafield.h>
-#include <vala/valaflags.h>
-#include <vala/valaflagsvalue.h>
#include <vala/valaforeachstatement.h>
#include <vala/valaformalparameter.h>
#include <vala/valaforstatement.h>
#include <vala/valareferencetransferexpression.h>
#include <vala/valareport.h>
#include <vala/valareturnstatement.h>
+#include <vala/valascope.h>
#include <vala/valasignal.h>
#include <vala/valasizeofexpression.h>
#include <vala/valasourcefile.h>
name = "%s]".printf (name);
length_field = new ArrayLengthField (source_reference);
- length_field.symbol = new Symbol (length_field);
resize_method = new ArrayResizeMethod (source_reference);
- resize_method.symbol = new Symbol (resize_method);
}
/**
access = MemberAccessibility.PUBLIC;
var root_symbol = source_reference.file.context.root;
- type_reference.data_type = (DataType) root_symbol.lookup ("int").node;
+ type_reference.data_type = (DataType) root_symbol.scope.lookup ("int");
}
/**
var root_symbol = source_reference.file.context.root;
var int_type = new TypeReference ();
- int_type.data_type = (DataType) root_symbol.lookup ("int").node;
+ int_type.data_type = (DataType) root_symbol.scope.lookup ("int");
add_parameter (new FormalParameter ("length", int_type));
public override void visit_namespace (Namespace! ns) {
ns.process_attributes ();
+
+ foreach (Namespace ns in ns.get_namespaces ()) {
+ ns.accept (this);
+ }
}
public override void visit_class (Class! cl) {
en.process_attributes ();
}
- public override void visit_flags (Flags! fl) {
- fl.process_attributes ();
- }
-
public override void visit_method (Method! m) {
m.process_attributes ();
}
/**
* Represents a source code block.
*/
-public class Vala.Block : Statement {
+public class Vala.Block : Symbol, Statement {
/**
* Specifies whether this block contains a jump statement. This
* information can be used to remove unreachable block cleanup code.
*
* @param source reference to source code
*/
- public Block (SourceReference source = null) {
- source_reference = source;
+ public Block (construct SourceReference source_reference = null) {
}
/**
/* valabreakstatement.vala
*
- * Copyright (C) 2006 Jürg Billeter
+ * Copyright (C) 2006-2007 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
/**
* Represents a break statement in the source code.
*/
-public class Vala.BreakStatement : Statement {
+public class Vala.BreakStatement : CodeNode, Statement {
/**
* Creates a new break statement.
*
* @param source reference to source code
* @return newly created callback
*/
- public Callback (string _name, TypeReference _return_type, SourceReference source = null) {
- name = _name;
- return_type = _return_type;
- source_reference = source;
+ public Callback (construct string name, construct TypeReference return_type, construct SourceReference source_reference = null) {
}
/**
public void add_type_parameter (TypeParameter! p) {
type_parameters.append (p);
p.type = this;
+ scope.add (p.name, p);
}
/**
*/
public void add_parameter (FormalParameter! param) {
parameters.append (param);
+ scope.add (param.name, param);
}
/**
public override string get_cname (bool const_type = false) {
if (cname == null) {
- cname = "%s%s".printf (@namespace.get_cprefix (), name);
+ cname = "%s%s".printf (parent_symbol.get_cprefix (), name);
}
return cname;
}
private List<Method> methods;
private List<Property> properties;
private List<Signal> signals;
+
+ // inner types
+ private List<Class> classes;
+ private List<Struct> structs;
/**
* Specifies the default construction method.
public void add_type_parameter (TypeParameter! p) {
type_parameters.append (p);
p.type = this;
+ scope.add (p.name, p);
}
/**
*/
public void add_constant (Constant! c) {
constants.append (c);
+ scope.add (c.name, c);
}
/**
if (f.access == MemberAccessibility.PRIVATE && f.instance) {
_has_private_fields = true;
}
+ scope.add (f.name, f);
}
/**
* @param m a method
*/
public void add_method (Method! m) {
+ if (m.instance) {
+ m.this_parameter = new FormalParameter ("this", new TypeReference ());
+ m.this_parameter.type_reference.data_type = this;
+ m.scope.add (m.this_parameter.name, m.this_parameter);
+ }
+ if (m is CreationMethod && m.name == null) {
+ default_construction_method = m;
+ }
+
methods.append (m);
+ scope.add (m.name, m);
}
/**
*/
public void add_property (Property! prop, bool no_field = false) {
properties.append (prop);
+ scope.add (prop.name, prop);
+
+ prop.this_parameter = new FormalParameter ("this", new TypeReference ());
+ prop.this_parameter.type_reference.data_type = this;
+ prop.scope.add (prop.this_parameter.name, prop.this_parameter);
if (!no_field && prop.set_accessor != null && prop.set_accessor.body == null &&
source_reference != null && !source_reference.file.pkg) {
*/
public void add_signal (Signal! sig) {
signals.append (sig);
+ scope.add (sig.name, sig);
}
/**
return signals.copy ();
}
+ /**
+ * Adds the specified class as an inner class.
+ *
+ * @param cl a class
+ */
+ public void add_class (Class! cl) {
+ classes.append (cl);
+ scope.add (cl.name, cl);
+ }
+
+ /**
+ * Adds the specified struct as an inner struct.
+ *
+ * @param st a struct
+ */
+ public void add_struct (Struct! st) {
+ structs.append (st);
+ scope.add (st.name, st);
+ }
+
public override void accept (CodeVisitor! visitor) {
visitor.visit_class (this);
}
if (destructor != null) {
destructor.accept (visitor);
}
+
+ foreach (Class cl in classes) {
+ cl.accept (visitor);
+ }
+
+ foreach (Struct st in structs) {
+ st.accept (visitor);
+ }
+ }
+
+ public override string! get_cprefix () {
+ return get_cname ();
}
public override string get_cname (bool const_type = false) {
if (cname == null) {
- cname = "%s%s".printf (@namespace.get_cprefix (), name);
+ cname = "%s%s".printf (parent_symbol.get_cprefix (), name);
}
return cname;
}
private string get_lower_case_csuffix () {
if (lower_case_csuffix == null) {
- lower_case_csuffix = Namespace.camel_case_to_lower_case (name);
+ lower_case_csuffix = camel_case_to_lower_case (name);
}
return lower_case_csuffix;
}
if (infix == null) {
infix = "";
}
- return "%s%s%s".printf (@namespace.get_lower_case_cprefix (), infix, get_lower_case_csuffix ());
+ return "%s%s%s".printf (parent_symbol.get_lower_case_cprefix (), infix, get_lower_case_csuffix ());
}
- public override string get_lower_case_cprefix () {
+ public override string! get_lower_case_cprefix () {
return "%s_".printf (get_lower_case_cname (null));
}
public Method module_init_method { get; set; }
List<SourceFile> source_files;
- private Symbol! _root = new Symbol ();
-
- private Namespace global_namespace = new Namespace (null);
- private List<Namespace> namespaces;
+ private Namespace! _root = new Namespace (null);
List<SourceFileCycle> cycles;
private List<string> packages;
/**
- * The root symbol of the code tree.
- *
- * @return root symbol
- */
- public Symbol! root {
- get { return _root; }
- }
-
- /**
- * Adds the specified namespace.
- *
- * @param ns a namespace
- */
- public void add_namespace (Namespace! ns) {
- namespaces.append (ns);
- }
-
- /**
- * Returns the implicitly declared root namespace.
+ * The root namespace of the symbol tree.
*
* @return root namespace
*/
- public Namespace! get_global_namespace () {
- return global_namespace;
- }
-
- /**
- * Returns a copy of the list of namespaces.
- *
- * @return namespace list
- */
- public List<weak Namespace> get_namespaces () {
- return namespaces.copy ();
+ public Namespace! root {
+ get { return _root; }
}
/**
* @param visitor the visitor to be called when traversing
*/
public void accept (CodeVisitor! visitor) {
- global_namespace.accept (visitor);
-
- foreach (Namespace ns in namespaces) {
- ns.accept (visitor);
- }
+ root.accept (visitor);
foreach (SourceFile file in source_files) {
file.accept (visitor);
* Parent of this code node.
*/
public CodeNode parent_node { get; set; }
-
- /**
- * Symbol that corresponds to this code node.
- */
- public Symbol symbol { get; set; }
-
+
/**
* References the location in the source file where this code node has
* been written.
}
/**
- * Visit operation called for flags.
- *
- * @param fl a flags
- */
- public virtual void visit_flags (Flags! fl) {
- }
-
- /**
- * Visit operation called for flags values.
- *
- * @param fv an flags value
- */
- public virtual void visit_flags_value (FlagsValue! fv) {
- }
-
- /**
* Visit operation called for callbacks.
*
* @param cb a callback
*/
public class Vala.Constant : Member, Lockable {
/**
- * The symbol name of this constant.
- */
- public string! name { get; set construct; }
-
- /**
* The data type of this constant.
*/
public TypeReference! type_reference { get; set construct; }
*/
public string! get_cname () {
if (cname == null) {
- if (symbol.parent_symbol.node is DataType) {
- var t = (DataType) symbol.parent_symbol.node;
- cname = "%s%s".printf (t.get_lower_case_cprefix ().up (), name);
+ if (parent_symbol == null) {
+ // global constant
+ cname = name;
} else {
- var ns = (Namespace) symbol.parent_symbol.node;
- if (ns == null) {
- // global constant
- cname = name;
- } else {
- cname = "%s%s".printf (ns.get_lower_case_cprefix ().up (), name);
- }
+ cname = "%s%s".printf (parent_symbol.get_lower_case_cprefix ().up (), name);
}
}
return cname;
/**
* Represents a class or instance constructor.
*/
-public class Vala.Constructor : CodeNode {
+public class Vala.Constructor : Symbol {
/**
* The body of this constructor.
*/
- public Statement body { get; set; }
+ public Block body { get; set; }
+
+ /**
+ * Specifies the generated `this' parameter for instance methods.
+ */
+ public FormalParameter this_parameter { get; set; }
private bool _instance = true;
/* valacontinuestatement.vala
*
- * Copyright (C) 2006 Jürg Billeter
+ * Copyright (C) 2006-2007 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
/**
* Represents a continue statement in the source code.
*/
-public class Vala.ContinueStatement : Statement {
+public class Vala.ContinueStatement : CodeNode, Statement {
/**
* Creates a new continue statement.
*
}
public override string! get_default_cname () {
- var parent = symbol.parent_symbol.node;
+ var parent = parent_symbol;
assert (parent is DataType);
if (name == null) {
return "%snew".printf (((DataType) parent).get_lower_case_cprefix ());
* Represents a runtime data type. This data type may be defined in Vala source
* code or imported from an external library with a Vala API file.
*/
-public abstract class Vala.DataType : CodeNode {
- /**
- * The symbol name of this data type.
- */
- public string name { get; set; }
-
+public abstract class Vala.DataType : Symbol {
/**
* Specifies the accessibility of the class. Public accessibility
* doesn't limit access. Default accessibility limits access to this
*/
public MemberAccessibility access;
- /**
- * The namespace containing this data type.
- */
- public weak Namespace @namespace;
-
private List<string> cheader_filenames;
private Pointer pointer_type;
public virtual string get_upper_case_cname (string infix = null) {
return null;
}
-
- /**
- * Returns the C name of this data type in lower case. Words are
- * separated by underscores. The lower case C name of the namespace is
- * prefix of the result.
- *
- * @param infix a string to be placed between namespace and data type
- * name or null
- * @return the lower case name to be used in C code
- */
- public virtual string get_lower_case_cname (string infix = null) {
- return null;
- }
-
- /**
- * Returns the string to be prefixed to members of this data type in
- * lower case when used in C code.
- *
- * @return the lower case prefix to be used in C code
- */
- public virtual string get_lower_case_cprefix () {
- return null;
- }
/**
* Returns the default value for the given type. Returning null means
public virtual List<weak string> get_cheader_filenames () {
if (cheader_filenames == null) {
/* default to header filenames of the namespace */
- foreach (string filename in @namespace.get_cheader_filenames ()) {
+ foreach (string filename in parent_symbol.get_cheader_filenames ()) {
add_cheader_filename (filename);
}
if (pointer_type == null) {
pointer_type = new Pointer (this, source_reference);
/* create a new Symbol */
- pointer_type.symbol = new Symbol (pointer_type);
- this.symbol.parent_symbol.add (pointer_type.name, pointer_type.symbol);
+ parent_symbol.scope.add (pointer_type.name, pointer_type);
/* link the namespace */
- pointer_type.@namespace = this.@namespace;
+ pointer_type.owner = parent_symbol.scope;
}
return pointer_type;
if (array_type == null) {
var new_array_type = new Array (this, rank, source_reference);
- /* create a new Symbol */
- new_array_type.symbol = new Symbol (new_array_type);
- this.symbol.parent_symbol.add (new_array_type.name, new_array_type.symbol);
+ parent_symbol.scope.add (new_array_type.name, new_array_type);
/* add internal length field */
- new_array_type.symbol.add (new_array_type.get_length_field ().name, new_array_type.get_length_field ().symbol);
+ new_array_type.scope.add (new_array_type.get_length_field ().name, new_array_type.get_length_field ());
/* add internal resize method */
- new_array_type.symbol.add (new_array_type.get_resize_method ().name, new_array_type.get_resize_method ().symbol);
+ new_array_type.scope.add (new_array_type.get_resize_method ().name, new_array_type.get_resize_method ());
/* link the array type to the same source as the container type */
new_array_type.source_reference = this.source_reference;
- /* link the namespace */
- new_array_type.@namespace = this.@namespace;
array_types.insert (rank.to_string (), new_array_type);
/* valadeclarationstatement.vala
*
- * Copyright (C) 2006 Jürg Billeter
+ * Copyright (C) 2006-2007 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
/**
* Represents a local variable declaration statement in the source code.
*/
-public class Vala.DeclarationStatement : Statement {
+public class Vala.DeclarationStatement : CodeNode, Statement {
/**
* The local variable declaration.
*/
/**
* Represents a class or instance destructor.
*/
-public class Vala.Destructor : CodeNode {
+public class Vala.Destructor : Symbol {
/**
* The body of this constructor.
*/
- public Statement body { get; set; }
+ public Block body { get; set; }
private bool _instance = true;
* Specifies whether this is an instance or a class destructor.
*/
public bool instance {
- get {
- return _instance;
- }
- set {
- _instance = value;
- }
+ get { return _instance; }
+ set { _instance = value; }
}
/**
* Creates a new destructor.
*
- * @param source reference to source code
- * @return newly created destructor
+ * @param source_reference reference to source code
+ * @return newly created destructor
*/
- public Destructor (SourceReference source) {
- source_reference = source;
+ public Destructor (construct SourceReference source_reference = null) {
}
public override void accept (CodeVisitor! visitor) {
/* valadostatement.vala
*
- * Copyright (C) 2006 Jürg Billeter
+ * Copyright (C) 2006-2007 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
/**
* Represents a do iteration statement in the source code.
*/
-public class Vala.DoStatement : Statement {
+public class Vala.DoStatement : CodeNode, Statement {
/**
* Specifies the loop body.
*/
- public Statement body { get; set; }
+ public Block body { get; set; }
/**
* Specifies the loop condition.
* @param source reference to source code
* @return newly created do statement
*/
- public DoStatement (Statement! _body, Expression! cond, SourceReference source) {
- body = _body;
- condition = cond;
- source_reference = source;
+ public DoStatement (construct Block! body, construct Expression! condition, construct SourceReference source_reference = null) {
}
public override void accept (CodeVisitor! visitor) {
/* valaemptystatement.vala
*
- * Copyright (C) 2006 Jürg Billeter
+ * Copyright (C) 2006-2007 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
/**
* An empty statement.
*/
-public class Vala.EmptyStatement : Statement {
+public class Vala.EmptyStatement : CodeNode, Statement {
/**
* Creates a new empty statement.
*
*/
public void add_value (EnumValue! value) {
values.append (value);
+ scope.add (value.name, value);
}
/**
* @param m a method
*/
public void add_method (Method! m) {
+ if (m is CreationMethod) {
+ Report.error (m.source_reference, "construction methods may only be declared within classes and structs");
+
+ m.error = true;
+ return;
+ }
+ if (m.instance) {
+ m.this_parameter = new FormalParameter ("this", new TypeReference ());
+ m.this_parameter.type_reference.data_type = this;
+ m.scope.add (m.this_parameter.name, m.this_parameter);
+ }
+
methods.append (m);
+ scope.add (m.name, m);
}
/**
public override string get_cname (bool const_type = false) {
if (cname == null) {
- cname = "%s%s".printf (@namespace.get_cprefix (), name);
+ cname = "%s%s".printf (parent_symbol.get_cprefix (), name);
}
return cname;
}
- public override string get_lower_case_cprefix () {
+ public override string! get_lower_case_cprefix () {
if (lower_case_cprefix == null) {
lower_case_cprefix = "%s_".printf (get_lower_case_cname (null));
}
private string get_lower_case_csuffix () {
if (lower_case_csuffix == null) {
- lower_case_csuffix = Namespace.camel_case_to_lower_case (name);
+ lower_case_csuffix = camel_case_to_lower_case (name);
}
return lower_case_csuffix;
}
if (infix == null) {
infix = "";
}
- return "%s%s%s".printf (@namespace.get_lower_case_cprefix (), infix, get_lower_case_csuffix ());
+ return "%s%s%s".printf (parent_symbol.get_lower_case_cprefix (), infix, get_lower_case_csuffix ());
}
public override string get_upper_case_cname (string infix) {
- return "%s%s".printf (@namespace.get_lower_case_cprefix (), Namespace.camel_case_to_lower_case (name)).up ();
+ return "%s%s".printf (parent_symbol.get_lower_case_cprefix (), camel_case_to_lower_case (name)).up ();
}
public override bool is_reference_type () {
/**
* Represents an enum member in the source code.
*/
-public class Vala.EnumValue : CodeNode {
- /**
- * The symbol name of this enum value.
- */
- public string! name { get; set construct; }
-
+public class Vala.EnumValue : Symbol {
/**
* Specifies the numerical representation of this enum value.
*/
* @param name enum value name
* @return newly created enum value
*/
- public EnumValue (string! _name) {
- name = _name;
+ public EnumValue (construct string! name) {
}
/**
* @param value numerical representation
* @return newly created enum value
*/
- public EnumValue.with_value (string! _name, Expression _value) {
- name = _name;
- value = _value;
+ public EnumValue.with_value (construct string! name, construct Expression value) {
}
public override void accept (CodeVisitor! visitor) {
*/
public string! get_cname () {
if (cname == null) {
- var en = (Enum) symbol.parent_symbol.node;
+ var en = (Enum) parent_symbol;
cname = "%s%s".printf (en.get_cprefix (), name);
}
return cname;
/* valaexpressionstatement.vala
*
- * Copyright (C) 2006 Jürg Billeter
+ * Copyright (C) 2006-2007 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
* A code statement that evaluates a given expression. The value computed by the
* expression, if any, is discarded.
*/
-public class Vala.ExpressionStatement : Statement {
+public class Vala.ExpressionStatement : CodeNode, Statement {
/**
* Specifies the expression to evaluate.
*/
* @param source reference to source code
* @return newly created expression statement
*/
- public ExpressionStatement (Expression! expr, SourceReference source = null) {
- expression = expr;
- source_reference = source;
+ public ExpressionStatement (construct Expression! expression, construct SourceReference source_reference = null) {
}
public override void accept (CodeVisitor! visitor) {
}
}
- public override int get_number_of_set_construction_parameters () {
+ /**
+ * Returns whether this statement sets a property.
+ *
+ * @return true if this statement sets a property, false otherwise
+ */
+ public bool sets_property () {
if (expression is Assignment) {
var assign = (Assignment) expression;
if (assign.left is MemberAccess) {
var ma = (MemberAccess) assign.left;
- if (ma.symbol_reference != null) {
- if (ma.symbol_reference.node is Property) {
- var prop = (Property) ma.symbol_reference.node;
- return 1;
- }
- }
+ return (ma.symbol_reference is Property);
}
}
- return -1;
+ return false;
}
}
*/
public class Vala.Field : Member, Invokable, Lockable {
/**
- * The symbol name of this field.
- */
- public string! name { get; set construct; }
-
- /**
* The data type of this field.
*/
public TypeReference! type_reference { get; set construct; }
* the contained type.
*/
public bool instance {
- get {
- return _instance;
- }
- set {
- _instance = value;
- }
+ get { return _instance; }
+ set { _instance = value; }
}
/**
* @param source reference to source code
* @return newly created field
*/
- public Field (string! _name, TypeReference! type, Expression init, SourceReference source) {
- name = _name;
- type_reference = type;
- initializer = init;
- source_reference = source;
+ public Field (construct string! name, construct TypeReference! type_reference, construct Expression initializer, construct SourceReference source_reference = null) {
}
public override void accept (CodeVisitor! visitor) {
*/
public string! get_cname () {
if (cname == null) {
- if (!instance && symbol.parent_symbol.node is DataType) {
- var t = (DataType) symbol.parent_symbol.node;
- cname = "%s_%s".printf (t.get_lower_case_cname (null), name);
+ if (!instance) {
+ cname = "%s_%s".printf (parent_symbol.get_lower_case_cname (null), name);
} else {
cname = name;
}
+++ /dev/null
-/* valaflags.vala
- *
- * Copyright (C) 2006-2007 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 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;
-
-/**
- * Represents a flags declaration in the source code.
- */
-public class Vala.Flags : DataType {
- private List<FlagsValue> values;
- private string cname;
- private string cprefix;
-
- /**
- * Creates a new flags.
- *
- * @param name type name
- * @param source reference to source code
- * @return newly created flags
- */
- public Flags (construct string! name, construct SourceReference source_reference = null) {
- }
-
- /**
- * Appends the specified flags value to the list of values.
- *
- * @param value a flags value
- */
- public void add_value (FlagsValue! value) {
- values.append (value);
- }
-
- public override void accept (CodeVisitor! visitor) {
- visitor.visit_flags (this);
- }
-
- public override void accept_children (CodeVisitor! visitor) {
- foreach (FlagsValue value in values) {
- value.accept (visitor);
- }
- }
-
- public override string get_cname (bool const_type = false) {
- if (cname == null) {
- cname = "%s%s".printf (@namespace.get_cprefix (), name);
- }
- return cname;
- }
-
- public override string get_upper_case_cname (string infix) {
- return "%s%s".printf (@namespace.get_lower_case_cprefix (), Namespace.camel_case_to_lower_case (name)).up ();
- }
-
- public override bool is_reference_type () {
- return false;
- }
-
- private void set_cname (string! cname) {
- this.cname = cname;
- }
-
- /**
- * Returns the string to be prepended to the name of members of this
- * enum when used in C code.
- *
- * @return the prefix to be used in C code
- */
- public string! get_cprefix () {
- if (cprefix == null) {
- cprefix = "%s_".printf (get_upper_case_cname (null));
- }
- return cprefix;
- }
-
- /**
- * Sets the string to be prepended to the name of members of this enum
- * when used in C code.
- *
- * @param cprefix the prefix to be used in C code
- */
- public void set_cprefix (string! cprefix) {
- this.cprefix = cprefix;
- }
-
- private void process_ccode_attribute (Attribute! a) {
- if (a.has_argument ("cname")) {
- set_cname (a.get_string ("cname"));
- }
- if (a.has_argument ("cprefix")) {
- set_cprefix (a.get_string ("cprefix"));
- }
- if (a.has_argument ("cheader_filename")) {
- var val = a.get_string ("cheader_filename");
- foreach (string filename in val.split (",")) {
- add_cheader_filename (filename);
- }
- }
- }
-
- /**
- * Process all associated attributes.
- */
- public void process_attributes () {
- foreach (Attribute a in attributes) {
- if (a.name == "CCode") {
- process_ccode_attribute (a);
- }
- }
- }
-
- public override string get_type_id () {
- // FIXME: use GType-registered flags
- return "G_TYPE_INT";
- }
-
- public override string get_marshaller_type_name () {
- return "FLAGS";
- }
-
- public override string get_get_value_function () {
- return "g_value_get_flags";
- }
-
- public override string get_set_value_function () {
- return "g_value_set_flags";
- }
-
- public override string get_default_value () {
- return "0";
- }
-}
+++ /dev/null
-/* valaflagsvalue.vala
- *
- * Copyright (C) 2006 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 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;
-
-/**
- * Represents a flags member in the source code.
- */
-public class Vala.FlagsValue : CodeNode {
- /**
- * The symbol name of this flags value.
- */
- public string! name { get; set construct; }
-
- /**
- * Specifies the numerical representation of this flags value.
- */
- public Expression value { get; set; }
-
- private string cname;
-
- /**
- * Creates a new flags value.
- *
- * @param name flags value name
- * @return newly created flags value
- */
- public FlagsValue (string! _name) {
- name = _name;
- }
-
- /**
- * Creates a new flags value with the specified numerical
- * representation.
- *
- * @param name flags value name
- * @param value numerical representation
- * @return newly created flags value
- */
- public FlagsValue.with_value (string! _name, Expression _value) {
- name = _name;
- value = _value;
- }
-
- public override void accept (CodeVisitor! visitor) {
- visitor.visit_flags_value (this);
- }
-
- /**
- * Returns the name of this flags value as it is used in C code.
- *
- * @return the name to be used in C code
- */
- public string! get_cname () {
- if (cname == null) {
- var fl = (Flags) symbol.parent_symbol.node;
- cname = "%s_%s".printf (fl.get_upper_case_cname (null), name);
- }
- return cname;
- }
-}
* Represents a foreach statement in the source code. Foreach statements iterate
* over the elements of a collection.
*/
-public class Vala.ForeachStatement : Statement {
+public class Vala.ForeachStatement : CodeNode, Statement {
/**
* Specifies the element type.
*/
/**
* Specifies the loop body.
*/
- public Statement body { get; set; }
+ public Block body { get; set; }
/**
* Specifies the declarator for the generated element variable.
* @param source reference to source code
* @return newly created foreach statement
*/
- public ForeachStatement (TypeReference! type, string! id, Expression! col, Statement _body, SourceReference source) {
- type_reference = type;
- variable_name = id;
- collection = col;
- body = _body;
- source_reference = source;
+ public ForeachStatement (construct TypeReference! type_reference, construct string! variable_name, construct Expression! collection, construct Block body, construct SourceReference source_reference) {
}
public override void accept (CodeVisitor! visitor) {
/**
* Represents a formal parameter in method and callback signatures.
*/
-public class Vala.FormalParameter : CodeNode, Invokable {
- /**
- * The parameter name.
- */
- public string! name { get; set construct; }
-
+public class Vala.FormalParameter : Symbol, Invokable {
/**
* The parameter type.
*/
/**
* Represents a for iteration statement in the source code.
*/
-public class Vala.ForStatement : Statement {
+public class Vala.ForStatement : CodeNode, Statement {
/**
* Specifies the loop condition.
*/
/**
* Specifies the loop body.
*/
- public Statement body { get; set; }
+ public Block body { get; set; }
private List<Expression> initializer;
private List<Expression> iterator;
* @param source reference to source code
* @return newly created for statement
*/
- public ForStatement (Expression cond, Statement _body, SourceReference source) {
- condition = cond;
- body = _body;
- source_reference = source;
+ public ForStatement (construct Expression condition, construct Block body, construct SourceReference source_reference = null) {
}
/**
/* valaifstatement.vala
*
- * Copyright (C) 2006 Jürg Billeter
+ * Copyright (C) 2006-2007 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
/**
* Represents an if selection statement in the source code.
*/
-public class Vala.IfStatement : Statement {
+public class Vala.IfStatement : CodeNode, Statement {
/**
* The boolean condition to evaluate.
*/
* @param source reference to source code
* @return newly created interface
*/
- public Interface (string! _name, SourceReference source = null) {
- name = _name;
- source_reference = source;
+ public Interface (construct string! name, construct SourceReference source_reference = null) {
}
/**
public void add_type_parameter (TypeParameter! p) {
type_parameters.append (p);
p.type = this;
+ scope.add (p.name, p);
}
/**
* @param m a method
*/
public void add_method (Method! m) {
+ if (m is CreationMethod) {
+ Report.error (m.source_reference, "construction methods may only be declared within classes and structs");
+
+ m.error = true;
+ return;
+ }
+ if (m.instance) {
+ m.this_parameter = new FormalParameter ("this", new TypeReference ());
+ m.this_parameter.type_reference.data_type = this;
+ m.scope.add (m.this_parameter.name, m.this_parameter);
+ }
+
methods.append (m);
+ scope.add (m.name, m);
}
/**
*/
public void add_property (Property! prop) {
properties.append (prop);
+ scope.add (prop.name, prop);
}
/**
*/
public void add_signal (Signal! sig) {
signals.append (sig);
+ scope.add (sig.name, sig);
}
/**
public override string get_cname (bool const_type = false) {
if (cname == null) {
- cname = "%s%s".printf (@namespace.get_cprefix (), name);
+ cname = "%s%s".printf (parent_symbol.get_cprefix (), name);
}
return cname;
}
*/
public string! get_lower_case_csuffix () {
if (lower_case_csuffix == null) {
- lower_case_csuffix = Namespace.camel_case_to_lower_case (name);
+ lower_case_csuffix = camel_case_to_lower_case (name);
}
return lower_case_csuffix;
}
if (infix == null) {
infix = "";
}
- return "%s%s%s".printf (@namespace.get_lower_case_cprefix (), infix, get_lower_case_csuffix ());
+ return "%s%s%s".printf (parent_symbol.get_lower_case_cprefix (), infix, get_lower_case_csuffix ());
}
- public override string get_lower_case_cprefix () {
+ public override string! get_lower_case_cprefix () {
return "%s_".printf (get_lower_case_cname (null));
}
}
public override void visit_namespace (Namespace! ns) {
- if (ns.source_reference != null && ns.source_reference.file.pkg) {
+ if (ns.pkg) {
return;
}
return;
}
- current_cheader_filename = ns.get_cheader_filename ();
-
write_indent ();
- write_string ("[CCode (cprefix = \"%s\", lower_case_cprefix = \"%s\", cheader_filename = \"%s\")]".printf (ns.get_cprefix (), ns.get_lower_case_cprefix (), current_cheader_filename));
+ write_string ("[CCode (cprefix = \"%s\", lower_case_cprefix = \"%s\")]".printf (ns.get_cprefix (), ns.get_lower_case_cprefix ()));
write_newline ();
write_indent ();
} else {
first = false;
}
- write_string (base_type.data_type.symbol.get_full_name ());
+ write_string (base_type.data_type.get_full_name ());
}
}
write_begin_block ();
}
write_indent ();
+
+ var first = true;
+ string cheaders;
+ foreach (string cheader in st.get_cheader_filenames ()) {
+ if (first) {
+ cheaders = cheader;
+ first = false;
+ } else {
+ cheaders = "%s, %s".printf (cheaders, cheader);
+ }
+ }
+ write_string ("[CCode (cheader_filename = \"%s\")]".printf (cheaders));
+ write_newline ();
+
+ write_indent ();
write_string ("public struct ");
write_identifier (st.name);
write_begin_block ();
}
write_indent ();
- write_string ("[CCode (cprefix = \"%s\")]".printf (en.get_cprefix ()));
+
+ var first = true;
+ string cheaders;
+ foreach (string cheader in en.get_cheader_filenames ()) {
+ if (first) {
+ cheaders = cheader;
+ first = false;
+ } else {
+ cheaders = "%s, %s".printf (cheaders, cheader);
+ }
+ }
+ write_string ("[CCode (cprefix = \"%s\", cheader_filename = \"%s\")]".printf (en.get_cprefix (), cheaders));
write_indent ();
write_string ("public enum ");
write_newline ();
}
- public override void visit_flags (Flags! fl) {
- if (fl.source_reference != null && fl.source_reference.file.pkg) {
- return;
- }
-
- if (fl.access == MemberAccessibility.PRIVATE) {
- return;
- }
-
- write_indent ();
- write_string ("[CCode (cprefix = \"%s\")]".printf (fl.get_cprefix ()));
-
- write_indent ();
- write_string ("public flags ");
- write_identifier (fl.name);
- write_begin_block ();
-
- fl.accept_children (this);
-
- write_end_block ();
- write_newline ();
- }
-
- public override void visit_flags_value (FlagsValue! fv) {
- write_indent ();
- write_identifier (fv.name);
- write_string (",");
- write_newline ();
- }
-
public override void visit_constant (Constant! c) {
if (c.source_reference != null && c.source_reference.file.pkg) {
return;
write_indent ();
write_string ("public const ");
- write_string (c.type_reference.data_type.symbol.get_full_name ());
+ write_string (c.type_reference.data_type.get_full_name ());
write_string (" ");
write_identifier (c.name);
!f.type_reference.takes_ownership) {
write_string ("weak ");
}
- write_string (f.type_reference.data_type.symbol.get_full_name ());
+ write_string (f.type_reference.data_type.get_full_name ());
var type_args = f.type_reference.get_type_arguments ();
if (!(f.type_reference.data_type is Array) && type_args != null) {
if (!type_arg.takes_ownership) {
write_string ("weak ");
}
- write_string (type_arg.data_type.symbol.get_full_name ());
+ write_string (type_arg.data_type.get_full_name ());
}
write_string (">");
}
} else if (param.type_reference.is_out) {
write_string ("out ");
}
- write_string (param.type_reference.data_type.symbol.get_full_name ());
+ write_string (param.type_reference.data_type.get_full_name ());
var type_args = param.type_reference.get_type_arguments ();
if (!(param.type_reference.data_type is Array) && type_args != null) {
if (!type_arg.takes_ownership) {
write_string ("weak ");
}
- write_string (type_arg.data_type.symbol.get_full_name ());
+ write_string (type_arg.data_type.get_full_name ());
}
write_string (">");
}
if (cb.return_type.transfers_ownership) {
write_string ("ref ");
}
- write_string (cb.return_type.data_type.symbol.get_full_name ());
+ write_string (cb.return_type.data_type.get_full_name ());
}
write_string (" ");
}
public override void visit_method (Method! m) {
+ if (m.source_reference != null && m.source_reference.file.pkg) {
+ return;
+ }
+
if (m.access == MemberAccessibility.PRIVATE || m.overrides) {
return;
}
if (m is CreationMethod) {
write_string (" ");
- var datatype = (DataType) m.symbol.parent_symbol.node;
+ var datatype = (DataType) m.parent_symbol;
write_identifier (datatype.name);
if (m.name != null) {
} else if ((m.return_type.data_type != null && m.return_type.data_type.is_reference_type ()) || m.return_type.type_parameter != null) {
write_string ("weak ");
}
- write_string (m.return_type.data_type.symbol.get_full_name ());
+ write_string (m.return_type.data_type.get_full_name ());
if (m.return_type.non_null) {
write_string ("!");
}
if (!prop.type_reference.takes_ownership) {
write_string ("weak ");
}
- write_string (prop.type_reference.data_type.symbol.get_full_name ());
+ write_string (prop.type_reference.data_type.get_full_name ());
var type_args = prop.type_reference.get_type_arguments ();
if (!(prop.type_reference.data_type is Array) && type_args != null) {
if (!type_arg.takes_ownership) {
write_string ("weak ");
}
- write_string (type_arg.data_type.symbol.get_full_name ());
+ write_string (type_arg.data_type.get_full_name ());
}
write_string (">");
}
if (sig.return_type.transfers_ownership) {
write_string ("ref ");
}
- write_string (sig.return_type.data_type.symbol.get_full_name ());
+ write_string (sig.return_type.data_type.get_full_name ());
if (sig.return_type.non_null) {
write_string ("!");
}
}
private void write_identifier (string! s) {
- if (s == "base" || s == "callback" || s == "class" ||
- s == "construct" || s == "flags" || s == "foreach" ||
+ if (s == "base" || s == "class" ||
+ s == "construct" || s == "delegate" || s == "foreach" ||
s == "in" || s == "interface" || s == "lock" ||
s == "namespace" || s == "out" || s == "ref") {
stream.putc ('@');
/* valalockstatement.vala
*
- * Copyright (C) 2006 Raffaele Sandrini
+ * Copyright (C) 2006-2007 Raffaele Sandrini, 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
/**
* Represents a lock statement e.g. "lock (a) { f(a) }".
*/
-public class Vala.LockStatement : Statement {
+public class Vala.LockStatement : CodeNode, Statement {
/**
* Expression representing the resource to be locked.
*/
/**
* The statement during its execution the resource is locked.
*/
- public Statement! body { get; set construct; }
+ public Block! body { get; set construct; }
- public LockStatement (Expression _resource, Statement _body, SourceReference source) {
- resource = _resource;
- body = _body;
- source_reference = source;
+ public LockStatement (construct Expression resource, construct Block body, construct SourceReference source_reference = null) {
}
public override void accept (CodeVisitor! visitor) {
/* valamember.vala
*
- * Copyright (C) 2006 Raffaele Sandrini
+ * Copyright (C) 2006-2007 Raffaele Sandrini, 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
/**
* Represents a general class member.
*/
-public class Vala.Member : CodeNode {
+public class Vala.Member : Symbol {
public override void accept (CodeVisitor! visitor) {
visitor.visit_member (this);
}
}
public override void visit_method (Method! m) {
- current_symbol = m.symbol;
+ current_symbol = m;
m.accept_children (this);
}
}
public override void visit_property (Property! prop) {
- current_symbol = prop.symbol;
+ current_symbol = prop;
prop.accept_children (this);
}
public override void visit_end_return_statement (ReturnStatement! stmt) {
if (stmt.return_expression != null) {
- if (current_symbol.node is Method) {
- var m = (Method) current_symbol.node;
+ if (current_symbol is Method) {
+ var m = (Method) current_symbol;
if (m.return_type.transfers_ownership) {
visit_possibly_missing_copy_expression (stmt.return_expression);
List<weak FormalParameter> params;
var msym = expr.call.symbol_reference;
- if (msym.node is VariableDeclarator) {
- var decl = (VariableDeclarator) msym.node;
+ if (msym is VariableDeclarator) {
+ var decl = (VariableDeclarator) msym;
var cb = (Callback) decl.type_reference.data_type;
params = cb.get_parameters ();
- } else if (msym.node is FormalParameter) {
- var param = (FormalParameter) msym.node;
+ } else if (msym is FormalParameter) {
+ var param = (FormalParameter) msym;
var cb = (Callback) param.type_reference.data_type;
params = cb.get_parameters ();
- } else if (msym.node is Field) {
- var f = (Field) msym.node;
+ } else if (msym is Field) {
+ var f = (Field) msym;
var cb = (Callback) f.type_reference.data_type;
params = cb.get_parameters ();
- } else if (msym.node is Method) {
- var m = (Method) msym.node;
+ } else if (msym is Method) {
+ var m = (Method) msym;
params = m.get_parameters ();
- } else if (msym.node is Signal) {
- var sig = (Signal) msym.node;
+ } else if (msym is Signal) {
+ var sig = (Signal) msym;
params = sig.get_parameters ();
}
weak List<weak FormalParameter> params_it = params;
var ma = (MemberAccess) expr.call;
TypeReference instance_type = ma.inner.static_type;
// trace type arguments back to the datatype where the method has been declared
- while (instance_type.data_type != msym.parent_symbol.node) {
+ while (instance_type.data_type != msym.parent_symbol) {
List<weak TypeReference> base_types = null;
if (instance_type.data_type is Class) {
var cl = (Class) instance_type.data_type;
return;
}
foreach (TypeReference base_type in base_types) {
- if (SemanticAnalyzer.symbol_lookup_inherited (base_type.data_type.symbol, msym.name) != null) {
+ if (SemanticAnalyzer.symbol_lookup_inherited (base_type.data_type, msym.name) != null) {
// construct a new type reference for the base type with correctly linked type arguments
var instance_base_type = new TypeReference ();
instance_base_type.data_type = base_type.data_type;
}
}
}
- if (instance_type.data_type != msym.parent_symbol.node) {
+ if (instance_type.data_type != msym.parent_symbol) {
Report.error (expr.source_reference, "internal error: generic type parameter tracing not supported yet");
expr.error = true;
return;
}
public override void visit_end_assignment (Assignment! a) {
- if (a.left is PointerIndirection || (a.left.symbol_reference != null && a.left.symbol_reference.node is Signal)) {
+ if (a.left is PointerIndirection || a.left.symbol_reference is Signal) {
} else {
if (a.left.static_type.takes_ownership) {
visit_possibly_missing_copy_expression (a.right);
*/
public class Vala.Method : Member, Invokable {
/**
- * The symbol name of this method.
- */
- public string name { get; set; }
-
- /**
* The return type of this method.
*/
public TypeReference return_type { get; set; }
* @param source reference to source code
* @return newly created method
*/
- public Method (string _name, TypeReference _return_type, SourceReference source = null) {
- name = _name;
- return_type = _return_type;
- source_reference = source;
+ public Method (construct string name, construct TypeReference return_type, construct SourceReference source_reference = null) {
}
/**
}
parameters.append (param);
+ if (!param.ellipsis) {
+ scope.add (param.name, param);
+ }
}
public List<weak FormalParameter> get_parameters () {
* @return the name to be used in C code by default
*/
public virtual string! get_default_cname () {
- var parent = symbol.parent_symbol.node;
- if (parent is DataType) {
- if (name.has_prefix ("_")) {
- return "_%s%s".printf (((DataType) parent).get_lower_case_cprefix (), name.offset (1));
- } else {
- return "%s%s".printf (((DataType) parent).get_lower_case_cprefix (), name);
- }
- } else if (parent is Namespace) {
- return "%s%s".printf (((Namespace) parent).get_lower_case_cprefix (), name);
+ if (name.has_prefix ("_")) {
+ return "_%s%s".printf (parent_symbol.get_lower_case_cprefix (), name.offset (1));
} else {
- return name;
+ return "%s%s".printf (parent_symbol.get_lower_case_cprefix (), name);
}
}
*/
public string! get_real_cname () {
if (base_method != null || base_interface_method != null) {
- var parent = (Class) symbol.parent_symbol.node;
- return "%s_real_%s".printf (parent.get_lower_case_cname (null), name);
+ return "%s_real_%s".printf (parent_symbol.get_lower_case_cname (null), name);
} else {
return get_cname ();
}
/**
* Represents a namespace declaration in the source code.
*/
-public class Vala.Namespace : CodeNode {
+public class Vala.Namespace : Symbol {
/**
- * The name of this namespace.
+ * Specifies whether this namespace is only used in a VAPI package file.
*/
- public string name { get; set; }
+ public bool pkg { get; set; }
private List<Class> classes;
private List<Interface> interfaces;
private List<Struct> structs;
private List<Enum> enums;
- private List<Flags> flags_;
private List<Callback> callbacks;
private List<Constant> constants;
private List<Field> fields;
private string lower_case_cprefix;
private List<string> cheader_filenames;
-
+
+ private List<Namespace> namespaces;
+
/**
* Creates a new namespace.
*
* @param source reference to source code
* @return newly created namespace
*/
- public Namespace (string _name, SourceReference source = null) {
- name = _name;
- source_reference = source;
+ public Namespace (construct string name, construct SourceReference source_reference = null) {
}
/**
- * Adds the specified class to this namespace.
+ * Adds the specified namespace to this source file.
*
- * @param cl a class
+ * @param ns a namespace
*/
- public void add_class (Class! cl) {
- classes.append (cl);
- cl.@namespace = this;
+ public void add_namespace (Namespace! ns) {
+ namespaces.append (ns);
+ scope.add (ns.name, ns);
}
-
+
/**
- * Removes the specified class from this namespace.
+ * Returns a copy of the list of namespaces.
+ *
+ * @return namespace list
+ */
+ public List<weak Namespace> get_namespaces () {
+ return namespaces.copy ();
+ }
+
+ /**
+ * Adds the specified class to this namespace.
*
* @param cl a class
*/
- public void remove_class (Class! cl) {
- cl.@namespace = null;
- classes.remove (cl);
+ public void add_class (Class! cl) {
+ classes.append (cl);
+ scope.add (cl.name, cl);
}
/**
*/
public void add_interface (Interface! iface) {
interfaces.append (iface);
- iface.@namespace = this;
+ scope.add (iface.name, iface);
}
/**
*/
public void add_struct (Struct! st) {
structs.append (st);
- st.@namespace = this;
+ scope.add (st.name, st);
}
/**
*/
public void add_enum (Enum! en) {
enums.append (en);
- en.@namespace = this;
+ scope.add (en.name, en);
}
/**
- * Adds the specified flags to this namespace.
- *
- * @param fl a flags
- */
- public void add_flags (Flags! fl) {
- flags_.append (fl);
- fl.@namespace = this;
- }
-
- /**
* Adds the specified callback to this namespace.
*
* @param cb a callback
*/
public void add_callback (Callback! cb) {
callbacks.append (cb);
- cb.@namespace = this;
+ scope.add (cb.name, cb);
}
/**
*/
public void add_constant (Constant! constant) {
constants.append (constant);
+ scope.add (constant.name, constant);
}
/**
*/
public void add_field (Field! f) {
fields.append (f);
+ scope.add (f.name, f);
}
/**
* @param m a method
*/
public void add_method (Method! m) {
+ if (m is CreationMethod) {
+ Report.error (m.source_reference, "construction methods may only be declared within classes and structs");
+
+ m.error = true;
+ return;
+ }
+ if (m.instance) {
+ Report.error (m.source_reference, "instance methods not allowed outside of data types");
+
+ m.error = true;
+ return;
+ }
+
methods.append (m);
+ scope.add (m.name, m);
}
public override void accept (CodeVisitor! visitor) {
}
public override void accept_children (CodeVisitor! visitor) {
- /* process enums and flags first to avoid order problems in C code */
- foreach (Enum en in enums) {
- en.accept (visitor);
+ foreach (Namespace ns in namespaces) {
+ ns.accept (visitor);
}
- foreach (Flags fl in flags_) {
- fl.accept (visitor);
+ /* process enums first to avoid order problems in C code */
+ foreach (Enum en in enums) {
+ en.accept (visitor);
}
foreach (Class cl in classes) {
m.accept (visitor);
}
}
-
- /**
- * Converts a string from CamelCase to lower_case.
- *
- * @param camel_case a string in camel case
- * @return the specified string converted to lower case
- */
- public static string! camel_case_to_lower_case (string! camel_case) {
- String result = new String ("");
-
- weak string i = camel_case;
-
- bool first = true;
- while (i.len () > 0) {
- unichar c = i.get_char ();
- if (c.isupper () && !first) {
- /* current character is upper case and
- * we're not at the beginning */
- weak string t = i.prev_char ();
- bool prev_upper = t.get_char ().isupper ();
- t = i.next_char ();
- bool next_upper = t.get_char ().isupper ();
- if (!prev_upper || (i.len () >= 2 && !next_upper)) {
- /* previous character wasn't upper case or
- * next character isn't upper case*/
- int len = result.str.len ();
- if (len != 1 && result.str.offset (len - 2).get_char () != '_') {
- /* we're not creating 1 character words */
- result.append_c ('_');
- }
- }
- }
-
- result.append_unichar (c.tolower ());
-
- first = false;
- i = i.next_char ();
- }
-
- return result.str;
- }
- /**
- * Returns the camel case string to be prepended to the name of members
- * of this namespace when used in C code.
- *
- * @return the camel case prefix to be used in C code
- */
- public string! get_cprefix () {
+ public override string! get_cprefix () {
if (cprefix == null) {
if (name == null) {
cprefix = "";
*
* @return the lower case prefix to be used in C code
*/
- public string! get_lower_case_cprefix () {
+ public override string! get_lower_case_cprefix () {
if (lower_case_cprefix == null) {
if (name == null) {
lower_case_cprefix = "";
this.lower_case_cprefix = cprefix;
}
- /**
- * Returns a list of C header filenames users of this namespace must
- * include.
- *
- * @return list of C header filenames for this namespace
- */
- public List<weak string> get_cheader_filenames () {
- if (cheader_filenames == null) {
- if (source_reference != null && !source_reference.file.pkg) {
- // don't add default include directives for VAPI files
- cheader_filenames.append (source_reference.file.get_cinclude_filename ());
- }
- }
+ public override List<weak string> get_cheader_filenames () {
return cheader_filenames.copy ();
}
*/
public class Vala.Property : Member, Lockable {
/**
- * The property name.
- */
- public string! name { get; set construct; }
-
- /**
* The property type.
*/
public TypeReference! type_reference { get; set construct; }
* @return the upper case name to be used in C code
*/
public string! get_upper_case_cname () {
- return "%s_%s".printf (((DataType) symbol.parent_symbol.node).get_lower_case_cname (null), Namespace.camel_case_to_lower_case (name)).up ();
+ return "%s_%s".printf (parent_symbol.get_lower_case_cname (null), camel_case_to_lower_case (name)).up ();
}
/**
*/
public class Vala.PropertyAccessor : CodeNode {
/**
+ * The corresponding property.
+ */
+ public weak Property prop { get; set; }
+
+ /**
* Specifies whether this accessor may be used to get the property.
*/
public bool readable { get; set; }
/**
* The accessor body.
*/
- public Statement body { get; set; }
+ public Block body { get; set; }
/**
* Represents the generated value parameter in a set accessor.
* @param source reference to source code
* @return newly created property accessor
*/
- public PropertyAccessor (bool _readable, bool _writable, bool _construction, Statement _body, SourceReference source) {
- readable = _readable;
- writable = _writable;
- construction = _construction;
- body = _body;
- source_reference = source;
+ public PropertyAccessor (construct bool readable, construct bool writable, construct bool construction, construct Block body, construct SourceReference source_reference) {
}
public override void accept (CodeVisitor! visitor) {
/* valareturnstatement.vala
*
- * Copyright (C) 2006 Jürg Billeter
+ * Copyright (C) 2006-2007 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
/**
* Represents a return statement in the source code.
*/
-public class Vala.ReturnStatement : Statement {
+public class Vala.ReturnStatement : CodeNode, Statement {
/**
* The optional expression to return.
*/
--- /dev/null
+/* valascope.vala
+ *
+ * Copyright (C) 2006-2007 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 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;
+
+/**
+ * Represents a part of the symbol tree.
+ */
+public class Vala.Scope {
+ /**
+ * The symbol that owns this scope.
+ */
+ public weak Symbol owner { get; set; }
+
+ /**
+ * The parent of this scope.
+ */
+ public weak Scope parent_scope { get; set; }
+
+ private HashTable<string,Symbol> symbol_table;
+
+ /**
+ * Creates a new scope.
+ *
+ * @return newly created scope
+ */
+ public Scope (construct Symbol owner = null) {
+ }
+
+ /**
+ * Adds the specified symbol with the specified name to the symbol table
+ * of this scope.
+ *
+ * @param name name for the specified symbol
+ * @param sym a symbol
+ */
+ public void add (string name, Symbol! sym) {
+ if (name != null) {
+ if (symbol_table == null) {
+ symbol_table = new HashTable.full (str_hash, str_equal, g_free, g_object_unref);
+ } else if (lookup (name) != null) {
+ owner.error = true;
+ Report.error (owner.source_reference, "`%s' already contains a definition for `%s'".printf (owner.get_full_name (), name));
+ return;
+ }
+
+ symbol_table.insert (name, sym);
+ }
+ sym.owner = this;
+ }
+
+ /**
+ * Returns the symbol stored in the symbol table with the specified
+ * name.
+ *
+ * @param name name of the symbol to be returned
+ * @return found symbol or null
+ */
+ public Symbol lookup (string! name) {
+ if (symbol_table == null) {
+ return null;
+ }
+ Symbol sym = symbol_table.lookup (name);
+ if (sym != null && !sym.active) {
+ sym = null;
+ }
+ return sym;
+ }
+}
+
root_symbol = context.root;
bool_type = new TypeReference ();
- bool_type.data_type = (DataType) root_symbol.lookup ("bool").node;
+ bool_type.data_type = (DataType) root_symbol.scope.lookup ("bool");
string_type = new TypeReference ();
- string_type.data_type = (DataType) root_symbol.lookup ("string").node;
+ string_type.data_type = (DataType) root_symbol.scope.lookup ("string");
- pointer_type = (DataType) root_symbol.lookup ("pointer").node;
+ pointer_type = (DataType) root_symbol.scope.lookup ("pointer");
int_type = new TypeReference ();
- int_type.data_type = (DataType) root_symbol.lookup ("int").node;
+ int_type.data_type = (DataType) root_symbol.scope.lookup ("int");
uint_type = new TypeReference ();
- uint_type.data_type = (DataType) root_symbol.lookup ("uint").node;
+ uint_type.data_type = (DataType) root_symbol.scope.lookup ("uint");
ulong_type = new TypeReference ();
- ulong_type.data_type = (DataType) root_symbol.lookup ("ulong").node;
+ ulong_type.data_type = (DataType) root_symbol.scope.lookup ("ulong");
unichar_type = new TypeReference ();
- unichar_type.data_type = (DataType) root_symbol.lookup ("unichar").node;
+ unichar_type.data_type = (DataType) root_symbol.scope.lookup ("unichar");
// TODO: don't require GLib namespace in semantic analyzer
- var glib_ns = root_symbol.lookup ("GLib");
+ var glib_ns = root_symbol.scope.lookup ("GLib");
if (glib_ns != null) {
- initially_unowned_type = (DataType) glib_ns.lookup ("InitiallyUnowned").node;
+ initially_unowned_type = (DataType) glib_ns.scope.lookup ("InitiallyUnowned");
type_type = new TypeReference ();
- type_type.data_type = (DataType) glib_ns.lookup ("Type").node;
+ type_type.data_type = (DataType) glib_ns.scope.lookup ("Type");
- glist_type = (DataType) glib_ns.lookup ("List").node;
- gslist_type = (DataType) glib_ns.lookup ("SList").node;
+ glist_type = (DataType) glib_ns.scope.lookup ("List");
+ gslist_type = (DataType) glib_ns.scope.lookup ("SList");
- gerror_type = (DataType) glib_ns.lookup ("Error").node;
+ gerror_type = (DataType) glib_ns.scope.lookup ("Error");
}
current_symbol = root_symbol;
}
public override void visit_class (Class! cl) {
- current_symbol = cl.symbol;
+ current_symbol = cl;
current_class = cl;
if (cl.base_class != null) {
- current_source_file.add_symbol_dependency (cl.base_class.symbol, SourceFileDependencyType.HEADER_FULL);
+ current_source_file.add_symbol_dependency (cl.base_class, SourceFileDependencyType.HEADER_FULL);
}
foreach (TypeReference base_type_reference in cl.get_base_types ()) {
- current_source_file.add_symbol_dependency (base_type_reference.data_type.symbol, SourceFileDependencyType.HEADER_FULL);
+ current_source_file.add_symbol_dependency (base_type_reference.data_type, SourceFileDependencyType.HEADER_FULL);
}
cl.accept_children (this);
List<string> missing_prereqs = null;
foreach (DataType prereq in prerequisites) {
if (!class_is_a (cl, prereq)) {
- missing_prereqs.prepend (prereq.symbol.get_full_name ());
+ missing_prereqs.prepend (prereq.get_full_name ());
}
}
/* report any missing prerequisites */
if (missing_prereqs != null) {
cl.error = true;
- string error_string = "%s: some prerequisites (".printf (cl.symbol.get_full_name ());
+ string error_string = "%s: some prerequisites (".printf (cl.get_full_name ());
bool first = true;
foreach (string s in missing_prereqs) {
if (first) {
/* check methods */
foreach (Method m in iface.get_methods ()) {
if (m.is_abstract) {
- var sym = cl.symbol.lookup (m.name);
- if (sym == null || !(sym.node is Method) || ((Method) sym.node).base_interface_method != m) {
+ var sym = cl.scope.lookup (m.name);
+ if (sym == null || !(sym is Method) || ((Method) sym).base_interface_method != m) {
cl.error = true;
- Report.error (cl.source_reference, "`%s' does not implement interface method `%s'".printf (cl.symbol.get_full_name (), m.symbol.get_full_name ()));
+ Report.error (cl.source_reference, "`%s' does not implement interface method `%s'".printf (cl.get_full_name (), m.get_full_name ()));
}
}
}
while (base_class != null && base_class.is_abstract) {
foreach (Method m in base_class.get_methods ()) {
if (m.is_abstract) {
- var sym = cl.symbol.lookup (m.name);
- if (sym == null || !(sym.node is Method) || ((Method) sym.node).base_method != m) {
+ var sym = cl.scope.lookup (m.name);
+ if (sym == null || !(sym is Method) || ((Method) sym).base_method != m) {
cl.error = true;
- Report.error (cl.source_reference, "`%s' does not implement abstract method `%s'".printf (cl.symbol.get_full_name (), m.symbol.get_full_name ()));
+ Report.error (cl.source_reference, "`%s' does not implement abstract method `%s'".printf (cl.get_full_name (), m.get_full_name ()));
}
}
}
}
public override void visit_struct (Struct! st) {
- current_symbol = st.symbol;
+ current_symbol = st;
current_struct = st;
st.accept_children (this);
}
public override void visit_interface (Interface! iface) {
- current_symbol = iface.symbol;
+ current_symbol = iface;
foreach (TypeReference prerequisite_reference in iface.get_prerequisites ()) {
- current_source_file.add_symbol_dependency (prerequisite_reference.data_type.symbol, SourceFileDependencyType.HEADER_FULL);
+ current_source_file.add_symbol_dependency (prerequisite_reference.data_type, SourceFileDependencyType.HEADER_FULL);
}
iface.accept_children (this);
if (class_or_interface is Class) {
if (prereq_class != null) {
iface.error = true;
- Report.error (iface.source_reference, "%s: Interfaces cannot have multiple instantiable prerequisites (`%s' and `%s')".printf (iface.symbol.get_full_name (), class_or_interface.symbol.get_full_name (), prereq_class.symbol.get_full_name ()));
+ Report.error (iface.source_reference, "%s: Interfaces cannot have multiple instantiable prerequisites (`%s' and `%s')".printf (iface.get_full_name (), class_or_interface.get_full_name (), prereq_class.get_full_name ()));
return;
}
if (f.access != MemberAccessibility.PRIVATE) {
if (f.type_reference.data_type != null) {
/* is null if it references a type parameter */
- current_source_file.add_symbol_dependency (f.type_reference.data_type.symbol, SourceFileDependencyType.HEADER_SHALLOW);
+ current_source_file.add_symbol_dependency (f.type_reference.data_type, SourceFileDependencyType.HEADER_SHALLOW);
}
} else {
if (f.type_reference.data_type != null) {
/* is null if it references a type parameter */
- current_source_file.add_symbol_dependency (f.type_reference.data_type.symbol, SourceFileDependencyType.SOURCE);
+ current_source_file.add_symbol_dependency (f.type_reference.data_type, SourceFileDependencyType.SOURCE);
}
}
}
public override void visit_method (Method! m) {
- current_symbol = m.symbol;
+ current_symbol = m;
current_return_type = m.return_type;
var init_attr = m.get_attribute ("ModuleInit");
if (m.return_type.data_type != null) {
/* is null if it is void or a reference to a type parameter */
- current_source_file.add_symbol_dependency (m.return_type.data_type.symbol, SourceFileDependencyType.HEADER_SHALLOW);
+ current_source_file.add_symbol_dependency (m.return_type.data_type, SourceFileDependencyType.HEADER_SHALLOW);
}
m.accept_children (this);
current_symbol = current_symbol.parent_symbol;
current_return_type = null;
- if (current_symbol.parent_symbol != null &&
- current_symbol.parent_symbol.node is Method) {
+ if (current_symbol.parent_symbol is Method) {
/* lambda expressions produce nested methods */
- var up_method = (Method) current_symbol.parent_symbol.node;
+ var up_method = (Method) current_symbol.parent_symbol;
current_return_type = up_method.return_type;
}
- if (current_symbol.node is Class) {
+ if (current_symbol is Class) {
if (!(m is CreationMethod)) {
- find_base_interface_method (m, (Class) current_symbol.node);
+ find_base_interface_method (m, (Class) current_symbol);
if (m.is_virtual || m.overrides) {
- find_base_class_method (m, (Class) current_symbol.node);
+ find_base_class_method (m, (Class) current_symbol);
if (m.base_method == null) {
- Report.error (m.source_reference, "%s: no suitable method found to override".printf (m.symbol.get_full_name ()));
+ Report.error (m.source_reference, "%s: no suitable method found to override".printf (m.get_full_name ()));
}
}
}
- } else if (current_symbol.node is Struct) {
+ } else if (current_symbol is Struct) {
if (m.is_abstract || m.is_virtual || m.overrides) {
- Report.error (m.source_reference, "A struct member `%s' cannot be marked as override, virtual, or abstract".printf (m.symbol.get_full_name ()));
+ Report.error (m.source_reference, "A struct member `%s' cannot be marked as override, virtual, or abstract".printf (m.get_full_name ()));
return;
}
}
}
private void find_base_class_method (Method! m, Class! cl) {
- var sym = cl.symbol.lookup (m.name);
- if (sym != null && sym.node is Method) {
- var base_method = (Method) sym.node;
+ var sym = cl.scope.lookup (m.name);
+ if (sym is Method) {
+ var base_method = (Method) sym;
if (base_method.is_abstract || base_method.is_virtual) {
if (!m.equals (base_method)) {
m.error = true;
- Report.error (m.source_reference, "Return type and/or parameters of overriding method `%s' do not match overridden method `%s'.".printf (m.symbol.get_full_name (), base_method.symbol.get_full_name ()));
+ Report.error (m.source_reference, "Return type and/or parameters of overriding method `%s' do not match overridden method `%s'.".printf (m.get_full_name (), base_method.get_full_name ()));
return;
}
// FIXME report error if multiple possible base methods are found
foreach (TypeReference type in cl.get_base_types ()) {
if (type.data_type is Interface) {
- var sym = type.data_type.symbol.lookup (m.name);
- if (sym != null && sym.node is Method) {
- var base_method = (Method) sym.node;
+ var sym = type.data_type.scope.lookup (m.name);
+ if (sym is Method) {
+ var base_method = (Method) sym;
if (base_method.is_abstract) {
if (!m.equals (base_method)) {
m.error = true;
- Report.error (m.source_reference, "Return type and/or parameters of overriding method `%s' do not match overridden method `%s'.".printf (m.symbol.get_full_name (), base_method.symbol.get_full_name ()));
+ Report.error (m.source_reference, "Return type and/or parameters of overriding method `%s' do not match overridden method `%s'.".printf (m.get_full_name (), base_method.get_full_name ()));
return;
}
public override void visit_creation_method (CreationMethod! m) {
m.return_type = new TypeReference ();
- m.return_type.data_type = (DataType) current_symbol.node;
+ m.return_type.data_type = (DataType) m.parent_symbol;
m.return_type.transfers_ownership = true;
- if (current_symbol.node is Class) {
+ if (current_symbol is Class) {
// check for floating reference
- var cl = (Class) current_symbol.node;
+ var cl = (Class) current_symbol;
while (cl != null) {
if (cl == initially_unowned_type) {
m.return_type.floating_reference = true;
}
}
- current_symbol = m.symbol;
+ current_symbol = m;
current_return_type = m.return_type;
m.accept_children (this);
current_symbol = current_symbol.parent_symbol;
current_return_type = null;
- if (current_symbol.parent_symbol != null &&
- current_symbol.parent_symbol.node is Method) {
+ if (current_symbol.parent_symbol is Method) {
/* lambda expressions produce nested methods */
- var up_method = (Method) current_symbol.parent_symbol.node;
+ var up_method = (Method) current_symbol.parent_symbol;
current_return_type = up_method.return_type;
}
- if (current_symbol.node is Class) {
+ if (current_symbol is Class) {
if (!(m is CreationMethod)) {
- find_base_interface_method (m, (Class) current_symbol.node);
+ find_base_interface_method (m, (Class) current_symbol);
if (m.is_virtual || m.overrides) {
- find_base_class_method (m, (Class) current_symbol.node);
+ find_base_class_method (m, (Class) current_symbol);
if (m.base_method == null) {
- Report.error (m.source_reference, "%s: no suitable method found to override".printf (m.symbol.get_full_name ()));
+ Report.error (m.source_reference, "%s: no suitable method found to override".printf (m.get_full_name ()));
}
}
}
- } else if (current_symbol.node is Struct) {
+ } else if (current_symbol is Struct) {
if (m.is_abstract || m.is_virtual || m.overrides) {
- Report.error (m.source_reference, "A struct member `%s' cannot be marked as override, virtual, or abstract".printf (m.symbol.get_full_name ()));
+ Report.error (m.source_reference, "A struct member `%s' cannot be marked as override, virtual, or abstract".printf (m.get_full_name ()));
return;
}
}
if (m.body != null && current_class != null) {
int n_params = 0;
foreach (Statement stmt in m.body.get_statements ()) {
- int params = stmt.get_number_of_set_construction_parameters ();
- if (params == -1) {
+ if (!(stmt is ExpressionStatement) || !((ExpressionStatement) stmt).sets_property ()) {
m.error = true;
Report.error (stmt.source_reference, "class creation methods only allow property assignment statements");
return;
}
- n_params += params;
+ n_params++;
}
m.n_construction_params = n_params;
}
if (!p.ellipsis) {
if (p.type_reference.data_type != null) {
/* is null if it references a type parameter */
- current_source_file.add_symbol_dependency (p.type_reference.data_type.symbol, SourceFileDependencyType.HEADER_SHALLOW);
- current_source_file.add_symbol_dependency (p.type_reference.data_type.symbol, SourceFileDependencyType.SOURCE);
+ current_source_file.add_symbol_dependency (p.type_reference.data_type, SourceFileDependencyType.HEADER_SHALLOW);
+ current_source_file.add_symbol_dependency (p.type_reference.data_type, SourceFileDependencyType.SOURCE);
}
}
/* special treatment for construct formal parameters used in creation methods */
if (p.construct_parameter) {
- if (!(p.symbol.parent_symbol.node is CreationMethod)) {
+ if (!(p.parent_symbol is CreationMethod)) {
p.error = true;
Report.error (p.source_reference, "construct parameters are only allowed in type creation methods");
return;
}
- var method_body = ((CreationMethod)p.symbol.parent_symbol.node).body;
+ var method_body = ((CreationMethod) p.parent_symbol).body;
var left = new MemberAccess.simple (p.name);
var right = new MemberAccess.simple (p.name);
/* try to lookup the requested property */
- var prop_sym = symbol_lookup_inherited (current_class.symbol, p.name);
- if (!(prop_sym.node is Property)) {
+ var prop_sym = symbol_lookup_inherited (current_class, p.name);
+ if (!(prop_sym is Property)) {
p.error = true;
- Report.error (p.source_reference, "class `%s' does not contain a property named `%s'".printf (current_class.symbol.get_full_name (), p.name));
+ Report.error (p.source_reference, "class `%s' does not contain a property named `%s'".printf (current_class.get_full_name (), p.name));
return;
}
left.symbol_reference = prop_sym;
- right.symbol_reference = p.symbol;
+ right.symbol_reference = p;
method_body.add_statement (new ExpressionStatement (new Assignment (left, right)));
}
}
private void find_base_class_property (Property! prop, Class! cl) {
- var sym = cl.symbol.lookup (prop.name);
- if (sym != null && sym.node is Property) {
- var base_property = (Property) sym.node;
+ var sym = cl.scope.lookup (prop.name);
+ if (sym is Property) {
+ var base_property = (Property) sym;
if (base_property.is_abstract || base_property.is_virtual) {
if (!prop.equals (base_property)) {
prop.error = true;
- Report.error (prop.source_reference, "Type and/or accessors of overriding property `%s' do not match overridden property `%s'.".printf (prop.symbol.get_full_name (), base_property.symbol.get_full_name ()));
+ Report.error (prop.source_reference, "Type and/or accessors of overriding property `%s' do not match overridden property `%s'.".printf (prop.get_full_name (), base_property.get_full_name ()));
return;
}
// FIXME report error if multiple possible base properties are found
foreach (TypeReference type in cl.get_base_types ()) {
if (type.data_type is Interface) {
- var sym = type.data_type.symbol.lookup (prop.name);
- if (sym != null && sym.node is Property) {
- var base_property = (Property) sym.node;
+ var sym = type.data_type.scope.lookup (prop.name);
+ if (sym is Property) {
+ var base_property = (Property) sym;
if (base_property.is_abstract) {
if (!prop.equals (base_property)) {
prop.error = true;
- Report.error (prop.source_reference, "Type and/or accessors of overriding property `%s' do not match overridden property `%s'.".printf (prop.symbol.get_full_name (), base_property.symbol.get_full_name ()));
+ Report.error (prop.source_reference, "Type and/or accessors of overriding property `%s' do not match overridden property `%s'.".printf (prop.get_full_name (), base_property.get_full_name ()));
return;
}
}
public override void visit_property (Property! prop) {
+ current_symbol = prop;
+
prop.accept_children (this);
+ current_symbol = current_symbol.parent_symbol;
+
if (prop.type_reference.data_type != null) {
/* is null if it references a type parameter */
- current_source_file.add_symbol_dependency (prop.type_reference.data_type.symbol, SourceFileDependencyType.HEADER_SHALLOW);
- current_source_file.add_symbol_dependency (prop.type_reference.data_type.symbol, SourceFileDependencyType.SOURCE);
+ current_source_file.add_symbol_dependency (prop.type_reference.data_type, SourceFileDependencyType.HEADER_SHALLOW);
+ current_source_file.add_symbol_dependency (prop.type_reference.data_type, SourceFileDependencyType.SOURCE);
}
- if (prop.symbol.parent_symbol.node is Class) {
- var cl = (Class) prop.symbol.parent_symbol.node;
+ if (prop.parent_symbol is Class) {
+ var cl = (Class) prop.parent_symbol;
find_base_interface_property (prop, cl);
if (prop.is_virtual || prop.overrides) {
find_base_class_property (prop, cl);
if (prop.base_property == null) {
prop.error = true;
- Report.error (prop.source_reference, "%s: no suitable property found to override".printf (prop.symbol.get_full_name ()));
+ Report.error (prop.source_reference, "%s: no suitable property found to override".printf (prop.get_full_name ()));
}
}
}
}
public override void visit_property_accessor (PropertyAccessor! acc) {
- var prop = (Property) acc.symbol.parent_symbol.node;
+ acc.prop = (Property) current_symbol;
if (acc.readable) {
- current_return_type = prop.type_reference;
+ current_return_type = acc.prop.type_reference;
} else {
// void
current_return_type = new TypeReference ();
}
+ if (!acc.source_reference.file.pkg) {
+ if (acc.body == null && !acc.prop.interface_only && !acc.prop.is_abstract) {
+ /* no accessor body specified, insert default body */
+
+ acc.body = new Block ();
+ if (acc.readable) {
+ acc.body.add_statement (new ReturnStatement (new MemberAccess.simple ("_%s".printf (acc.prop.name))));
+ } else {
+ acc.body.add_statement (new ExpressionStatement (new Assignment (new MemberAccess.simple ("_%s".printf (acc.prop.name)), new MemberAccess.simple ("value"))));
+ }
+ }
+
+ if (acc.writable || acc.construction) {
+ acc.value_parameter = new FormalParameter ("value", acc.prop.type_reference);
+ acc.body.scope.add (acc.value_parameter.name, acc.value_parameter);
+ }
+ }
+
acc.accept_children (this);
current_return_type = null;
}
public override void visit_constructor (Constructor! c) {
- current_symbol = c.symbol;
+ c.this_parameter = new FormalParameter ("this", new TypeReference ());
+ c.this_parameter.type_reference.data_type = (DataType) current_symbol;
+ c.scope.add (c.this_parameter.name, c.this_parameter);
+
+ c.owner = current_symbol.scope;
+ current_symbol = c;
c.accept_children (this);
}
public override void visit_destructor (Destructor! d) {
- current_symbol = d.symbol;
+ d.owner = current_symbol.scope;
+ current_symbol = d;
d.accept_children (this);
}
public override void visit_begin_block (Block! b) {
- current_symbol = b.symbol;
+ b.owner = current_symbol.scope;
+ current_symbol = b;
}
public override void visit_end_block (Block! b) {
foreach (VariableDeclarator decl in b.get_local_variables ()) {
- decl.symbol.active = false;
+ decl.active = false;
}
current_symbol = current_symbol.parent_symbol;
return;
}
- if (decl.initializer.symbol_reference.node is Method &&
+ if (decl.initializer.symbol_reference is Method &&
decl.type_reference.data_type is Callback) {
- var m = (Method) decl.initializer.symbol_reference.node;
+ var m = (Method) decl.initializer.symbol_reference;
var cb = (Callback) decl.type_reference.data_type;
/* check whether method matches callback type */
if (!cb.matches_method (m)) {
decl.error = true;
- Report.error (decl.source_reference, "declaration of method `%s' doesn't match declaration of callback `%s'".printf (m.symbol.get_full_name (), cb.symbol.get_full_name ()));
+ Report.error (decl.source_reference, "declaration of method `%s' doesn't match declaration of callback `%s'".printf (m.get_full_name (), cb.get_full_name ()));
return;
}
}
if (decl.type_reference.data_type != null) {
- current_source_file.add_symbol_dependency (decl.type_reference.data_type.symbol, SourceFileDependencyType.SOURCE);
+ current_source_file.add_symbol_dependency (decl.type_reference.data_type, SourceFileDependencyType.SOURCE);
}
- decl.symbol = new Symbol (decl);
- current_symbol.add (decl.name, decl.symbol);
+ current_symbol.scope.add (decl.name, decl);
- var block = (Block) current_symbol.node;
+ var block = (Block) current_symbol;
block.add_local_variable (decl);
- decl.symbol.active = true;
+ decl.active = true;
}
/**
public override void visit_begin_foreach_statement (ForeachStatement! stmt) {
if (stmt.type_reference.data_type != null) {
- current_source_file.add_symbol_dependency (stmt.type_reference.data_type.symbol, SourceFileDependencyType.SOURCE);
+ current_source_file.add_symbol_dependency (stmt.type_reference.data_type, SourceFileDependencyType.SOURCE);
}
stmt.variable_declarator = new VariableDeclarator (stmt.variable_name);
stmt.variable_declarator.type_reference = stmt.type_reference;
- stmt.variable_declarator.symbol = new Symbol (stmt.variable_declarator);
- stmt.body.symbol.add (stmt.variable_name, stmt.variable_declarator.symbol);
+ stmt.body.scope.add (stmt.variable_name, stmt.variable_declarator);
}
public override void visit_end_foreach_statement (ForeachStatement! stmt) {
}
if (stmt.return_expression != null &&
- stmt.return_expression.symbol_reference != null &&
- stmt.return_expression.symbol_reference.node is VariableDeclarator &&
+ stmt.return_expression.symbol_reference is VariableDeclarator &&
stmt.return_expression.static_type.takes_ownership &&
!current_return_type.transfers_ownership) {
Report.warning (stmt.source_reference, "Local variable with strong reference used as return value and method return type hasn't been declared to transfer ownership");
public override void visit_catch_clause (CatchClause! clause) {
if (clause.type_reference.data_type != null) {
- current_source_file.add_symbol_dependency (clause.type_reference.data_type.symbol, SourceFileDependencyType.SOURCE);
+ current_source_file.add_symbol_dependency (clause.type_reference.data_type, SourceFileDependencyType.SOURCE);
}
clause.variable_declarator = new VariableDeclarator (clause.variable_name);
clause.variable_declarator.type_reference = new TypeReference ();
clause.variable_declarator.type_reference.data_type = gerror_type;
- clause.variable_declarator.symbol = new Symbol (clause.variable_declarator);
- clause.body.symbol.add (clause.variable_name, clause.variable_declarator.symbol);
+ clause.body.scope.add (clause.variable_name, clause.variable_declarator);
clause.accept_children (this);
}
*/
public override void visit_lock_statement (LockStatement! stmt) {
/* resource must be a member access and denote a Lockable */
- if (!(stmt.resource is MemberAccess && stmt.resource.symbol_reference.node is Lockable)) {
+ if (!(stmt.resource is MemberAccess && stmt.resource.symbol_reference is Lockable)) {
stmt.error = true;
stmt.resource.error = true;
Report.error (stmt.resource.source_reference, "Expression is either not a member access or does not denote a lockable member");
}
/* parent symbol must be the current class */
- if (stmt.resource.symbol_reference.parent_symbol.node != current_class) {
+ if (stmt.resource.symbol_reference.parent_symbol != current_class) {
stmt.error = true;
stmt.resource.error = true;
Report.error (stmt.resource.source_reference, "Only members of the current class are lockable");
}
- ((Lockable)stmt.resource.symbol_reference.node).set_lock_used (true);
+ ((Lockable) stmt.resource.symbol_reference).set_lock_used (true);
}
public override void visit_begin_array_creation_expression (ArrayCreationExpression! expr) {
public override void visit_character_literal (CharacterLiteral! expr) {
expr.static_type = new TypeReference ();
- expr.static_type.data_type = (DataType) root_symbol.lookup ("char").node;
+ expr.static_type.data_type = (DataType) root_symbol.scope.lookup ("char");
}
public override void visit_integer_literal (IntegerLiteral! expr) {
expr.static_type = new TypeReference ();
- expr.static_type.data_type = (DataType) root_symbol.lookup (expr.get_type_name ()).node;
+ expr.static_type.data_type = (DataType) root_symbol.scope.lookup (expr.get_type_name ());
}
public override void visit_real_literal (RealLiteral! expr) {
expr.static_type = new TypeReference ();
- expr.static_type.data_type = (DataType) root_symbol.lookup (expr.get_type_name ()).node;
+ expr.static_type.data_type = (DataType) root_symbol.scope.lookup (expr.get_type_name ());
}
public override void visit_string_literal (StringLiteral! expr) {
expr.static_type = expr.literal.static_type;
}
- private TypeReference get_static_type_for_node (CodeNode! node) {
- if (node is Field) {
- var f = (Field) node;
+ private TypeReference get_static_type_for_symbol (Symbol! sym) {
+ if (sym is Field) {
+ var f = (Field) sym;
return f.type_reference;
- } else if (node is Constant) {
- var c = (Constant) node;
+ } else if (sym is Constant) {
+ var c = (Constant) sym;
return c.type_reference;
- } else if (node is Property) {
- var prop = (Property) node;
+ } else if (sym is Property) {
+ var prop = (Property) sym;
var type = prop.type_reference.copy ();
type.takes_ownership = false;
return type;
- } else if (node is FormalParameter) {
- var p = (FormalParameter) node;
+ } else if (sym is FormalParameter) {
+ var p = (FormalParameter) sym;
return p.type_reference;
- } else if (node is TypeReference) {
- return (TypeReference) node;
- } else if (node is VariableDeclarator) {
- var decl = (VariableDeclarator) node;
+ } else if (sym is TypeReference) {
+ return (TypeReference) sym;
+ } else if (sym is VariableDeclarator) {
+ var decl = (VariableDeclarator) sym;
return decl.type_reference;
- } else if (node is EnumValue || node is FlagsValue) {
+ } else if (sym is EnumValue) {
var type = new TypeReference ();
- type.data_type = (DataType) node.symbol.parent_symbol.node;
+ type.data_type = (DataType) sym.parent_symbol;
return type;
}
return null;
}
public static Symbol symbol_lookup_inherited (Symbol! sym, string! name) {
- var result = sym.lookup (name);
+ var result = sym.scope.lookup (name);
if (result != null) {
return result;
}
- if (sym.node is Class) {
- var cl = (Class) sym.node;
+ if (sym is Class) {
+ var cl = (Class) sym;
foreach (TypeReference base_type in cl.get_base_types ()) {
- result = symbol_lookup_inherited (base_type.data_type.symbol, name);
+ result = symbol_lookup_inherited (base_type.data_type, name);
if (result != null) {
return result;
}
}
- } else if (sym.node is Struct) {
- var st = (Struct) sym.node;
+ } else if (sym is Struct) {
+ var st = (Struct) sym;
foreach (TypeReference base_type in st.get_base_types ()) {
- result = symbol_lookup_inherited (base_type.data_type.symbol, name);
+ result = symbol_lookup_inherited (base_type.data_type, name);
if (result != null) {
return result;
}
}
- } else if (sym.node is Interface) {
- var iface = (Interface) sym.node;
+ } else if (sym is Interface) {
+ var iface = (Interface) sym;
foreach (TypeReference prerequisite in iface.get_prerequisites ()) {
- result = symbol_lookup_inherited (prerequisite.data_type.symbol, name);
+ result = symbol_lookup_inherited (prerequisite.data_type, name);
if (result != null) {
return result;
}
private DataType find_parent_type (Symbol sym) {
while (sym != null) {
- if (sym.node is DataType) {
- return (DataType) sym.node;
+ if (sym is DataType) {
+ return (DataType) sym;
}
sym = sym.parent_symbol;
}
if (expr.symbol_reference == null) {
foreach (NamespaceReference ns in current_using_directives) {
- var local_sym = ns.namespace_symbol.lookup (expr.member_name);
+ var local_sym = ns.namespace_symbol.scope.lookup (expr.member_name);
if (local_sym != null) {
if (expr.symbol_reference != null) {
expr.error = true;
if (expr.inner is MemberAccess || expr.inner is BaseAccess) {
base_symbol = expr.inner.symbol_reference;
- if (base_symbol.node is Namespace ||
- base_symbol.node is DataType) {
- expr.symbol_reference = base_symbol.lookup (expr.member_name);
+ if (base_symbol is Namespace || base_symbol is DataType) {
+ expr.symbol_reference = base_symbol.scope.lookup (expr.member_name);
}
}
if (expr.symbol_reference == null && expr.inner.static_type != null) {
- base_symbol = expr.inner.static_type.data_type.symbol;
+ base_symbol = expr.inner.static_type.data_type;
expr.symbol_reference = symbol_lookup_inherited (base_symbol, expr.member_name);
}
}
return;
}
- var member = expr.symbol_reference.node;
+ var member = expr.symbol_reference;
MemberAccessibility access = MemberAccessibility.PUBLIC;
if (member is Field) {
access = ((Field) member).access;
}
if (access == MemberAccessibility.PRIVATE) {
- var target_type = (DataType) member.symbol.parent_symbol.node;
+ var target_type = (DataType) member.parent_symbol;
var this_type = find_parent_type (current_symbol);
if (target_type != this_type) {
expr.error = true;
- Report.error (expr.source_reference, "Access to private member `%s' denied".printf (member.symbol.get_full_name ()));
+ Report.error (expr.source_reference, "Access to private member `%s' denied".printf (member.get_full_name ()));
return;
}
}
current_source_file.add_symbol_dependency (expr.symbol_reference, SourceFileDependencyType.SOURCE);
- expr.static_type = get_static_type_for_node (expr.symbol_reference.node);
+ expr.static_type = get_static_type_for_symbol (expr.symbol_reference);
}
private bool is_type_compatible (TypeReference! expression_type, TypeReference! expected_type) {
List<weak FormalParameter> params;
- if (msym.node is Invokable) {
- var m = (Invokable) msym.node;
+ if (msym is Invokable) {
+ var m = (Invokable) msym;
if (m.is_invokable ()) {
params = m.get_parameters ();
} else {
weak List<weak Expression> prev_arg_it = null;
weak List<weak Expression> arg_it = args;
- bool diag = (msym.node.get_attribute ("Diagnostics") != null);
+ bool diag = (msym.get_attribute ("Diagnostics") != null);
bool ellipsis = false;
int i = 0;
/* header file necessary if we need to cast argument */
if (param.type_reference.data_type != null) {
- current_source_file.add_symbol_dependency (param.type_reference.data_type.symbol, SourceFileDependencyType.SOURCE);
+ current_source_file.add_symbol_dependency (param.type_reference.data_type, SourceFileDependencyType.SOURCE);
}
if (arg_it == null) {
TypeReference ret_type;
List<weak FormalParameter> params;
- if (msym.node is Invokable) {
- var m = (Invokable) msym.node;
+ if (msym is Invokable) {
+ var m = (Invokable) msym;
ret_type = m.get_return_type ();
params = m.get_parameters ();
} else {
TypeReference instance_type = ma.inner.static_type;
// trace type arguments back to the datatype where the method has been declared
- while (instance_type.data_type != msym.parent_symbol.node) {
+ while (instance_type.data_type != msym.parent_symbol) {
List<weak TypeReference> base_types = null;
if (instance_type.data_type is Class) {
var cl = (Class) instance_type.data_type;
return;
}
foreach (TypeReference base_type in base_types) {
- if (symbol_lookup_inherited (base_type.data_type.symbol, msym.name) != null) {
+ if (symbol_lookup_inherited (base_type.data_type, msym.name) != null) {
// construct a new type reference for the base type with correctly linked type arguments
var instance_base_type = new TypeReference ();
instance_base_type.data_type = base_type.data_type;
}
}
}
- if (instance_type.data_type != msym.parent_symbol.node) {
+ if (instance_type.data_type != msym.parent_symbol) {
Report.error (expr.source_reference, "internal error: generic type parameter tracing not supported yet");
expr.error = true;
return;
}
}
- if (msym.node is Method) {
- var m = (Method) msym.node;
+ if (msym is Method) {
+ var m = (Method) msym;
expr.tree_can_fail = expr.can_fail = (m.get_error_domains ().length () > 0);
}
expr.static_type.data_type = current_class.base_class;
}
- expr.symbol_reference = expr.static_type.data_type.symbol;
+ expr.symbol_reference = expr.static_type.data_type;
}
public override void visit_postfix_expression (PostfixExpression! expr) {
return;
}
- var constructor_node = expr.member_name.symbol_reference.node;
- var type_node = expr.member_name.symbol_reference.node;
+ var constructor_sym = expr.member_name.symbol_reference;
+ var type_sym = expr.member_name.symbol_reference;
var type_args = expr.member_name.get_type_arguments ();
- if (constructor_node is Method) {
- type_node = constructor_node.symbol.parent_symbol.node;
+ if (constructor_sym is Method) {
+ type_sym = constructor_sym.parent_symbol;
- var constructor = (Method) constructor_node;
- if (!(constructor_node is CreationMethod)) {
+ var constructor = (Method) constructor_sym;
+ if (!(constructor_sym is CreationMethod)) {
expr.error = true;
- Report.error (expr.source_reference, "`%s' is not a creation method".printf (constructor.symbol.get_full_name ()));
+ Report.error (expr.source_reference, "`%s' is not a creation method".printf (constructor.get_full_name ()));
return;
}
- expr.symbol_reference = constructor.symbol;
+ expr.symbol_reference = constructor;
type_args = ((MemberAccess) expr.member_name.inner).get_type_arguments ();
- } else if (constructor_node is EnumValue) {
- type_node = constructor_node.symbol.parent_symbol.node;
+ } else if (constructor_sym is EnumValue) {
+ type_sym = constructor_sym.parent_symbol;
- expr.symbol_reference = constructor_node.symbol;
+ expr.symbol_reference = constructor_sym;
}
- if (type_node is Class || type_node is Struct) {
- type = (DataType) type_node;
- } else if (type_node is Enum && ((Enum) type_node).error_domain) {
- type = (DataType) type_node;
+ if (type_sym is Class || type_sym is Struct) {
+ type = (DataType) type_sym;
+ } else if (type_sym is Enum && ((Enum) type_sym).error_domain) {
+ type = (DataType) type_sym;
} else {
expr.error = true;
- Report.error (expr.source_reference, "`%s' is not a class, struct, or error domain".printf (type_node.symbol.get_full_name ()));
+ Report.error (expr.source_reference, "`%s' is not a class, struct, or error domain".printf (type_sym.get_full_name ()));
return;
}
return;
}
- current_source_file.add_symbol_dependency (type.symbol, SourceFileDependencyType.SOURCE);
+ current_source_file.add_symbol_dependency (type, SourceFileDependencyType.SOURCE);
expr.static_type = expr.type_reference.copy ();
expr.static_type.transfers_ownership = true;
if (cl.is_abstract) {
expr.static_type = null;
expr.error = true;
- Report.error (expr.source_reference, "Can't create instance of abstract class `%s'".printf (cl.symbol.get_full_name ()));
+ Report.error (expr.source_reference, "Can't create instance of abstract class `%s'".printf (cl.get_full_name ()));
return;
}
- if (expr.symbol_reference == null && cl.default_construction_method != null) {
- expr.symbol_reference = cl.default_construction_method.symbol;
+ if (expr.symbol_reference == null) {
+ expr.symbol_reference = cl.default_construction_method;
}
while (cl != null) {
} else if (type is Struct) {
var st = (Struct) type;
- if (expr.symbol_reference == null && st.default_construction_method != null) {
- expr.symbol_reference = st.default_construction_method.symbol;
+ if (expr.symbol_reference == null) {
+ expr.symbol_reference = st.default_construction_method;
}
}
if (expr.symbol_reference == null && expr.get_argument_list ().length () != 0) {
expr.static_type = null;
expr.error = true;
- Report.error (expr.source_reference, "No arguments allowed when constructing type `%s'".printf (type.symbol.get_full_name ()));
+ Report.error (expr.source_reference, "No arguments allowed when constructing type `%s'".printf (type.get_full_name ()));
return;
}
- if (expr.symbol_reference != null && expr.symbol_reference.node is Method) {
- var m = (Method) expr.symbol_reference.node;
- check_arguments (expr, m.symbol, m.get_parameters (), expr.get_argument_list ());
+ if (expr.symbol_reference is Method) {
+ var m = (Method) expr.symbol_reference;
+ check_arguments (expr, m, m.get_parameters (), expr.get_argument_list ());
expr.tree_can_fail = expr.can_fail = (m.get_error_domains ().length () > 0);
} else if (type is Enum) {
// FIXME: check whether cast is allowed
if (expr.type_reference.data_type != null) {
- current_source_file.add_symbol_dependency (expr.type_reference.data_type.symbol, SourceFileDependencyType.SOURCE);
+ current_source_file.add_symbol_dependency (expr.type_reference.data_type, SourceFileDependencyType.SOURCE);
}
expr.static_type = expr.type_reference;
return;
}
- current_source_file.add_symbol_dependency (expr.type_reference.data_type.symbol, SourceFileDependencyType.SOURCE);
+ current_source_file.add_symbol_dependency (expr.type_reference.data_type, SourceFileDependencyType.SOURCE);
expr.static_type = bool_type;
}
private Method find_current_method () {
var sym = current_symbol;
while (sym != null) {
- if (sym.node is Method) {
- return (Method) sym.node;
+ if (sym is Method) {
+ return (Method) sym;
}
sym = sym.parent_symbol;
}
private bool is_in_constructor () {
var sym = current_symbol;
while (sym != null) {
- if (sym.node is Constructor) {
+ if (sym is Constructor) {
return true;
}
sym = sym.parent_symbol;
var cb = (Callback) l.expected_type.data_type;
l.method = new Method (get_lambda_name (), cb.return_type);
l.method.instance = cb.instance && in_instance_method;
- l.method.symbol = new Symbol (l.method);
- l.method.symbol.parent_symbol = current_symbol;
+ l.method.owner = current_symbol.scope;
var lambda_params = l.get_parameters ();
weak List<weak FormalParameter> lambda_param_it = lambda_params;
var lambda_param = (string) lambda_param_it.data;
var param = new FormalParameter (lambda_param, cb_param.type_reference);
- param.symbol = new Symbol (param);
- l.method.symbol.add (param.name, param.symbol);
l.method.add_parameter (param);
if (l.expression_body != null) {
var block = new Block ();
- block.symbol = new Symbol (block);
- block.symbol.parent_symbol = l.method.symbol;
+ block.scope.parent_scope = l.method.scope;
if (l.method.return_type.data_type != null) {
block.add_statement (new ReturnStatement (l.expression_body));
l.method.body = block;
} else {
l.method.body = l.statement_body;
- l.method.body.symbol.parent_symbol = l.method.symbol;
}
+ l.method.body.owner = l.method.scope;
/* lambda expressions should be usable like MemberAccess of a method */
- l.symbol_reference = l.method.symbol;
+ l.symbol_reference = l.method;
}
public override void visit_begin_assignment (Assignment! a) {
return;
}
- if (ma.symbol_reference.node is Signal) {
- var sig = (Signal) ma.symbol_reference.node;
+ if (ma.symbol_reference is Signal) {
+ var sig = (Signal) ma.symbol_reference;
a.right.expected_type = new TypeReference ();
a.right.expected_type.data_type = sig.get_callback ();
var ma = (MemberAccess) a.left;
- if (!(ma.symbol_reference.node is Signal)) {
+ if (!(ma.symbol_reference is Signal)) {
var old_value = new MemberAccess (ma.inner, ma.member_name);
var bin = new BinaryExpression (BinaryOperator.PLUS, old_value, new ParenthesizedExpression (a.right, a.right.source_reference));
if (a.left is MemberAccess) {
var ma = (MemberAccess) a.left;
- if (ma.symbol_reference.node is Signal) {
- var sig = (Signal) ma.symbol_reference.node;
+ if (ma.symbol_reference is Signal) {
+ var sig = (Signal) ma.symbol_reference;
if (a.right.symbol_reference == null) {
a.error = true;
return;
}
- var m = (Method) a.right.symbol_reference.node;
+ var m = (Method) a.right.symbol_reference;
if (m.instance && m.access != MemberAccessibility.PRIVATE) {
/* TODO: generate wrapper function */
*/
m.instance_last = true;
}
- } else if (ma.symbol_reference.node is Property) {
- var prop = (Property) ma.symbol_reference.node;
+ } else if (ma.symbol_reference is Property) {
+ var prop = (Property) ma.symbol_reference;
if (prop.set_accessor == null) {
ma.error = true;
- Report.error (ma.source_reference, "Property `%s' is read-only".printf (prop.symbol.get_full_name ()));
+ Report.error (ma.source_reference, "Property `%s' is read-only".printf (prop.get_full_name ()));
return;
}
- } else if (ma.symbol_reference.node is VariableDeclarator && a.right.static_type == null) {
- var decl = (VariableDeclarator) ma.symbol_reference.node;
+ } else if (ma.symbol_reference is VariableDeclarator && a.right.static_type == null) {
+ var decl = (VariableDeclarator) ma.symbol_reference;
var right_ma = (MemberAccess) a.right;
- if (right_ma.symbol_reference.node is Method &&
+ if (right_ma.symbol_reference is Method &&
decl.type_reference.data_type is Callback) {
- var m = (Method) right_ma.symbol_reference.node;
+ var m = (Method) right_ma.symbol_reference;
var cb = (Callback) decl.type_reference.data_type;
/* check whether method matches callback type */
if (!cb.matches_method (m)) {
decl.error = true;
- Report.error (a.source_reference, "declaration of method `%s' doesn't match declaration of callback `%s'".printf (m.symbol.get_full_name (), cb.symbol.get_full_name ()));
+ Report.error (a.source_reference, "declaration of method `%s' doesn't match declaration of callback `%s'".printf (m.get_full_name (), cb.get_full_name ()));
return;
}
Report.error (a.source_reference, "Assignment: Invalid callback assignment attempt");
return;
}
- } else if (ma.symbol_reference.node is Field && a.right.static_type == null) {
- var f = (Field) ma.symbol_reference.node;
+ } else if (ma.symbol_reference is Field && a.right.static_type == null) {
+ var f = (Field) ma.symbol_reference;
var right_ma = (MemberAccess) a.right;
- if (right_ma.symbol_reference.node is Method &&
+ if (right_ma.symbol_reference is Method &&
f.type_reference.data_type is Callback) {
- var m = (Method) right_ma.symbol_reference.node;
+ var m = (Method) right_ma.symbol_reference;
var cb = (Callback) f.type_reference.data_type;
/* check whether method matches callback type */
if (!cb.matches_method (m)) {
f.error = true;
- Report.error (a.source_reference, "declaration of method `%s' doesn't match declaration of callback `%s'".printf (m.symbol.get_full_name (), cb.symbol.get_full_name ()));
+ Report.error (a.source_reference, "declaration of method `%s' doesn't match declaration of callback `%s'".printf (m.get_full_name (), cb.get_full_name ()));
return;
}
*/
public class Vala.Signal : Member, Invokable, Lockable {
/**
- * The symbol name of this signal.
- */
- public string! name { get; set construct; }
-
- /**
* The return type of handlers of this signal.
*/
public TypeReference! return_type { get; set construct; }
* @param source reference to source code
* @return newly created signal
*/
- public Signal (string! _name, TypeReference! _return_type, SourceReference source) {
- name = _name;
- return_type = _return_type;
- source_reference = source;
+ public Signal (construct string! name, construct TypeReference! return_type, construct SourceReference source_reference = null) {
}
/**
*/
public void add_parameter (FormalParameter! param) {
parameters.append (param);
+ scope.add (param.name, param);
}
public List<weak FormalParameter> get_parameters () {
generated_callback.instance = true;
var sender_type = new TypeReference ();
- sender_type.data_type = (DataType) symbol.parent_symbol.node;
+ sender_type.data_type = (DataType) parent_symbol;
var sender_param = new FormalParameter ("sender", sender_type);
generated_callback.add_parameter (sender_param);
* The context this source file belongs to.
*/
public weak CodeContext context { get; set; }
-
+
private List<NamespaceReference> using_directives;
private List<CodeNode> nodes;
* @param pkg true if this is a VAPI package file
* @return newly created source file
*/
- public SourceFile (CodeContext! _context, string! _filename, bool _pkg = false) {
- context = _context;
- filename = _filename;
- pkg = _pkg;
+ public SourceFile (construct CodeContext! context, construct string! filename, construct bool pkg = false) {
}
/**
public void add_symbol_dependency (Symbol! sym, SourceFileDependencyType dep_type) {
DataType t;
- if (sym.node is DataType) {
- t = (DataType) sym.node;
- } else if (sym.node is Method || sym.node is Field) {
- if (sym.parent_symbol.node is DataType) {
- t = (DataType) sym.parent_symbol.node;
+ if (sym is DataType) {
+ t = (DataType) sym;
+ } else if (sym is Method || sym is Field) {
+ if (sym.parent_symbol is DataType) {
+ t = (DataType) sym.parent_symbol;
} else {
return;
}
- } else if (sym.node is Property) {
- t = (DataType) sym.parent_symbol.node;
- } else if (sym.node is Constant) {
- if (sym.parent_symbol.node is DataType) {
- t = (DataType) sym.parent_symbol.node;
- } else if (sym.parent_symbol.node is Namespace) {
- var ns = (Namespace) sym.parent_symbol.node;
+ } else if (sym is Property) {
+ t = (DataType) sym.parent_symbol;
+ } else if (sym is Constant) {
+ if (sym.parent_symbol is DataType) {
+ t = (DataType) sym.parent_symbol;
+ } else if (sym.parent_symbol is Namespace) {
+ var ns = (Namespace) sym.parent_symbol;
source_internal_includes.concat (ns.get_cheader_filenames ());
return;
} else {
return;
}
- } else if (sym.node is FormalParameter) {
- var fp = (FormalParameter) sym.node;
+ } else if (sym is FormalParameter) {
+ var fp = (FormalParameter) sym;
t = fp.type_reference.data_type;
if (t == null) {
/* generic type parameter */
using GLib;
/**
- * Base class for all statement types.
+ * Interface for all statement types.
*/
-public abstract class Vala.Statement : CodeNode {
- /**
- * Returns the number of construction parameters this statement sets in
- * maximum or -1 if this statement may not be used in the construction
- * part of a construction method.
- *
- * @return number of construction parameters set or -1
- */
- public virtual int get_number_of_set_construction_parameters () {
- return -1;
- }
+public interface Vala.Statement : CodeNode {
}
public void add_type_parameter (TypeParameter! p) {
type_parameters.append (p);
p.type = this;
+ scope.add (p.name, p);
}
/**
*/
public void add_constant (Constant! c) {
constants.append (c);
+ scope.add (c.name, c);
}
/**
*/
public void add_field (Field! f) {
fields.append (f);
+ scope.add (f.name, f);
}
/**
public void add_method (Method! m) {
return_if_fail (m != null);
+ if (m.instance) {
+ m.this_parameter = new FormalParameter ("this", new TypeReference ());
+ m.this_parameter.type_reference.data_type = this;
+ m.scope.add (m.this_parameter.name, m.this_parameter);
+ }
+ if (m is CreationMethod && m.name == null) {
+ default_construction_method = m;
+ }
+
methods.append (m);
+ scope.add (m.name, m);
}
/**
}
if (cname == null) {
- cname = "%s%s".printf (@namespace.get_cprefix (), name);
+ cname = "%s%s".printf (parent_symbol.get_cprefix (), name);
}
return cname;
}
this.const_cname = cname;
}
- public override string get_lower_case_cprefix () {
+ public override string! get_lower_case_cprefix () {
if (lower_case_cprefix == null) {
lower_case_cprefix = "%s_".printf (get_lower_case_cname (null));
}
private string get_lower_case_csuffix () {
if (lower_case_csuffix == null) {
- lower_case_csuffix = Namespace.camel_case_to_lower_case (name);
+ lower_case_csuffix = camel_case_to_lower_case (name);
}
return lower_case_csuffix;
}
if (infix == null) {
infix = "";
}
- return "%s%s%s".printf (@namespace.get_lower_case_cprefix (), infix, get_lower_case_csuffix ());
+ return "%s%s%s".printf (parent_symbol.get_lower_case_cprefix (), infix, get_lower_case_csuffix ());
}
public override string get_upper_case_cname (string infix) {
public override string get_dup_function () {
if (dup_function == null) {
- Report.error (source_reference, "The type `%s` doesn't contain a copy function".printf (symbol.get_full_name ()));
+ Report.error (source_reference, "The type `%s` doesn't contain a copy function".printf (get_full_name ()));
}
return dup_function;
}
public override string get_free_function () {
if (free_function == null) {
- Report.error (source_reference, "The type `%s` doesn't contain a free function".printf (symbol.get_full_name ()));
+ Report.error (source_reference, "The type `%s` doesn't contain a free function".printf (get_full_name ()));
}
return free_function;
}
if (is_reference_type ()) {
type_id = "G_TYPE_POINTER";
} else {
- Report.error (source_reference, "The type `%s` doesn't declare a type id".printf (symbol.get_full_name ()));
+ Report.error (source_reference, "The type `%s` doesn't declare a type id".printf (get_full_name ()));
}
}
return type_id;
if (is_reference_type ()) {
marshaller_type_name = "POINTER";
} else {
- Report.error (source_reference, "The type `%s` doesn't declare a marshaller type name".printf (symbol.get_full_name ()));
+ Report.error (source_reference, "The type `%s` doesn't declare a marshaller type name".printf (get_full_name ()));
}
}
return marshaller_type_name;
if (is_reference_type ()) {
return "g_value_get_pointer";
} else {
- Report.error (source_reference, "The value type `%s` doesn't declare a GValue get function".printf (symbol.get_full_name ()));
+ Report.error (source_reference, "The value type `%s` doesn't declare a GValue get function".printf (get_full_name ()));
return null;
}
} else {
if (is_reference_type ()) {
return "g_value_set_pointer";
} else {
- Report.error (source_reference, "The value type `%s` doesn't declare a GValue set function".printf (symbol.get_full_name ()));
+ Report.error (source_reference, "The value type `%s` doesn't declare a GValue set function".printf (get_full_name ()));
return null;
}
} else {
/**
* Represents a switch selection statement in the source code.
*/
-public class Vala.SwitchStatement : Statement {
+public class Vala.SwitchStatement : CodeNode, Statement {
/**
* Specifies the switch expression.
*/
/**
* Represents a node in the symbol tree.
*/
-public class Vala.Symbol {
+public abstract class Vala.Symbol : CodeNode {
/**
- * The code node that created this symbol, if applicable.
+ * The parent of this symbol.
*/
- public weak CodeNode node { get; set; }
-
+ public weak Symbol parent_symbol {
+ get {
+ if (owner == null) {
+ return null;
+ } else {
+ return owner.owner;
+ }
+ }
+ }
+
/**
- * The parent of this symbol.
+ * The scope this symbol opens.
*/
- public weak Symbol parent_symbol { get; set; }
+ public weak Scope owner {
+ get {
+ return _owner;
+ }
+ set {
+ _owner = value;
+ _scope.parent_scope = value;
+ }
+ }
/**
* The symbol name.
* jump statements.
*/
public bool active { get; set; }
-
- private HashTable<string,Symbol> symbol_table = new HashTable.full (str_hash, str_equal, g_free, g_object_unref);
-
- /**
- * Creates a new symbol.
- *
- * @param node the corresponding code node
- * @return newly created symbol
- */
- public Symbol (CodeNode _node = null) {
- node = _node;
+
+ public Scope scope {
+ get { return _scope; }
}
-
+
+ private Scope _owner;
+ private Scope _scope;
+
construct {
+ _scope = new Scope (this);
active = true;
}
return "%s.%s".printf (parent_symbol.get_full_name (), name);
}
-
+
/**
- * Adds the specified symbol with the specified name to the symbol table
- * of this symbol.
+ * Returns the camel case string to be prepended to the name of members
+ * of this symbol when used in C code.
*
- * @param name name for the specified symbol
- * @param sym a symbol
+ * @return the camel case prefix to be used in C code
*/
- public void add (string! name, Symbol! sym) {
- symbol_table.insert (name, sym);
- sym.parent_symbol = this;
- sym.name = name;
+ public virtual string! get_cprefix () {
+ if (name == null) {
+ return "";
+ } else {
+ return name;
+ }
}
/**
- * Returns the symbol stored in the symbol table with the specified
- * name.
+ * Returns the C name of this symbol in lower case. Words are
+ * separated by underscores. The lower case C name of the parent symbol
+ * is prefix of the result, if there is one.
+ *
+ * @param infix a string to be placed between namespace and data type
+ * name or null
+ * @return the lower case name to be used in C code
+ */
+ public virtual string get_lower_case_cname (string infix = null) {
+ return null;
+ }
+
+ /**
+ * Returns the string to be prefixed to members of this symbol in
+ * lower case when used in C code.
+ *
+ * @return the lower case prefix to be used in C code
+ */
+ public virtual string! get_lower_case_cprefix () {
+ return "";
+ }
+
+ /**
+ * Returns a list of C header filenames users of this symbol must
+ * include.
+ *
+ * @return list of C header filenames for this symbol
+ */
+ public virtual List<weak string> get_cheader_filenames () {
+ return null;
+ }
+
+ /**
+ * Converts a string from CamelCase to lower_case.
*
- * @param name name of the symbol to be returned
- * @return found symbol or null
+ * @param camel_case a string in camel case
+ * @return the specified string converted to lower case
*/
- public Symbol lookup (string! name) {
- Symbol sym = symbol_table.lookup (name);
- if (sym != null && !sym.active) {
- sym = null;
+ public static string! camel_case_to_lower_case (string! camel_case) {
+ String result = new String ("");
+
+ weak string i = camel_case;
+
+ bool first = true;
+ while (i.len () > 0) {
+ unichar c = i.get_char ();
+ if (c.isupper () && !first) {
+ /* current character is upper case and
+ * we're not at the beginning */
+ weak string t = i.prev_char ();
+ bool prev_upper = t.get_char ().isupper ();
+ t = i.next_char ();
+ bool next_upper = t.get_char ().isupper ();
+ if (!prev_upper || (i.len () >= 2 && !next_upper)) {
+ /* previous character wasn't upper case or
+ * next character isn't upper case*/
+ int len = result.str.len ();
+ if (len != 1 && result.str.offset (len - 2).get_char () != '_') {
+ /* we're not creating 1 character words */
+ result.append_c ('_');
+ }
+ }
+ }
+
+ result.append_unichar (c.tolower ());
+
+ first = false;
+ i = i.next_char ();
}
- return sym;
+
+ return result.str;
}
}
+++ /dev/null
-/* valasymbolbuilder.vala
- *
- * Copyright (C) 2006-2007 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
- * License as published by the Free Software Foundation; either
- * version 2 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>
- * Raffaele Sandrini <rasa@gmx.ch>
- */
-
-using GLib;
-
-/**
- * Code visitor building the symbol tree.
- */
-public class Vala.SymbolBuilder : CodeVisitor {
- Symbol root;
- Symbol current_type;
- Symbol current_symbol;
-
- /**
- * Build the symbol tree for the specified code context.
- *
- * @param context a code context
- */
- public void build (CodeContext! context) {
- root = context.root;
- context.accept (this);
- }
-
- public override void visit_namespace (Namespace! ns) {
- if (ns.name == null) {
- ns.symbol = root;
- }
-
- if (ns.symbol == null) {
- ns.symbol = root.lookup (ns.name);
- }
- if (ns.symbol == null) {
- ns.symbol = new Symbol (ns);
- root.add (ns.name, ns.symbol);
- }
-
- current_symbol = ns.symbol;
-
- ns.accept_children (this);
-
- current_symbol = current_symbol.parent_symbol;
- }
-
- private weak Symbol add_symbol (string name, CodeNode! node) {
- if (name != null) {
- if (current_symbol.lookup (name) != null) {
- node.error = true;
- Report.error (node.source_reference, "`%s' already contains a definition for `%s'".printf (current_symbol.get_full_name (), name));
- return null;
- }
- }
- node.symbol = new Symbol (node);
- if (name != null) {
- current_symbol.add (name, node.symbol);
- } else {
- node.symbol.parent_symbol = current_symbol;
- }
-
- return node.symbol;
- }
-
- public override void visit_class (Class! cl) {
- if (cl.error) {
- /* skip classes with errors */
- return;
- }
-
- var class_symbol = current_symbol.lookup (cl.name);
- if (class_symbol == null || !(class_symbol.node is Class)) {
- class_symbol = add_symbol (cl.name, cl);
- } else {
- /* merge this class declaration with existing class symbol */
- var main_class = (Class) class_symbol.node;
- foreach (TypeReference base_type in cl.get_base_types ()) {
- main_class.add_base_type (base_type);
- }
- foreach (Field f in cl.get_fields ()) {
- main_class.add_field (f);
- }
- foreach (Method m in cl.get_methods ()) {
- main_class.add_method (m);
- }
- foreach (Property prop in cl.get_properties ()) {
- main_class.add_property (prop, true);
- }
- foreach (Signal sig in cl.get_signals ()) {
- main_class.add_signal (sig);
- }
- if (cl.constructor != null) {
- if (main_class.constructor != null) {
- cl.error = true;
- Report.error (cl.constructor.source_reference, "`%s' already contains a constructor".printf (current_symbol.get_full_name ()));
- return;
- }
- main_class.constructor = cl.constructor;
- }
- if (cl.destructor != null) {
- if (main_class.destructor != null) {
- cl.error = true;
- Report.error (cl.destructor.source_reference, "`%s' already contains a destructor".printf (current_symbol.get_full_name ()));
- return;
- }
- main_class.destructor = cl.destructor;
- }
- }
-
- current_symbol = class_symbol;
-
- cl.accept_children (this);
-
- current_symbol = current_symbol.parent_symbol;
-
- if (cl.symbol == null) {
- /* remove merged class */
- cl.@namespace.remove_class (cl);
- if (cl.source_reference != null) {
- cl.source_reference.file.remove_node (cl);
- }
- }
- }
-
- public override void visit_struct (Struct! st) {
- if (st.error) {
- /* skip structs with errors */
- return;
- }
-
- if (add_symbol (st.name, st) == null) {
- return;
- }
-
- current_symbol = st.symbol;
-
- st.accept_children (this);
-
- current_symbol = current_symbol.parent_symbol;
- }
-
- public override void visit_interface (Interface! iface) {
- if (iface.error) {
- /* skip interfaces with errors */
- return;
- }
-
- if (add_symbol (iface.name, iface) == null) {
- return;
- }
-
- current_symbol = iface.symbol;
-
- iface.accept_children (this);
-
- current_symbol = current_symbol.parent_symbol;
- }
-
- public override void visit_enum (Enum! en) {
- if (en.error) {
- /* skip enums with errors */
- return;
- }
-
- if (add_symbol (en.name, en) == null) {
- return;
- }
-
- current_symbol = en.symbol;
-
- en.accept_children (this);
-
- current_symbol = current_symbol.parent_symbol;
- }
-
- public override void visit_enum_value (EnumValue! ev) {
- ev.symbol = new Symbol (ev);
- current_symbol.add (ev.name, ev.symbol);
- }
-
- public override void visit_flags (Flags! fl) {
- if (fl.error) {
- /* skip flags with errors */
- return;
- }
-
- if (add_symbol (fl.name, fl) == null) {
- return;
- }
-
- current_symbol = fl.symbol;
-
- fl.accept_children (this);
-
- current_symbol = current_symbol.parent_symbol;
- }
-
- public override void visit_flags_value (FlagsValue! fv) {
- fv.symbol = new Symbol (fv);
- current_symbol.add (fv.name, fv.symbol);
- }
-
- public override void visit_callback (Callback! cb) {
- if (cb.error) {
- /* skip enums with errors */
- return;
- }
-
- if (add_symbol (cb.name, cb) == null) {
- return;
- }
-
- current_symbol = cb.symbol;
-
- cb.accept_children (this);
-
- current_symbol = current_symbol.parent_symbol;
- }
-
- public override void visit_constant (Constant! c) {
- add_symbol (c.name, c);
- }
-
- public override void visit_field (Field! f) {
- add_symbol (f.name, f);
- }
-
- public override void visit_method (Method! m) {
- if (add_symbol (m.name, m) == null) {
- return;
- }
-
- if (m.instance) {
- if (!(m.symbol.parent_symbol.node is DataType)) {
- Report.error (m.source_reference, "instance methods not allowed outside of data types");
-
- m.error = true;
- return;
- }
-
- m.this_parameter = new FormalParameter ("this", new TypeReference ());
- m.this_parameter.type_reference.data_type = (DataType) m.symbol.parent_symbol.node;
- m.this_parameter.symbol = new Symbol (m.this_parameter);
- current_symbol.add (m.this_parameter.name, m.this_parameter.symbol);
- }
-
- current_symbol = m.symbol;
-
- m.accept_children (this);
-
- current_symbol = current_symbol.parent_symbol;
- }
-
- public override void visit_creation_method (CreationMethod! m) {
- if (add_symbol (m.name, m) == null) {
- return;
- }
-
- var type_node = m.symbol.parent_symbol.node;
- if (!(type_node is Class || type_node is Struct)) {
- Report.error (m.source_reference, "construction methods may only be declared within classes and structs");
-
- m.error = true;
- return;
- }
-
- if (m.name == null) {
- if (type_node is Class) {
- ((Class) type_node).default_construction_method = m;
- } else if (type_node is Struct) {
- ((Struct) type_node).default_construction_method = m;
- }
- }
-
- current_symbol = m.symbol;
-
- m.accept_children (this);
-
- current_symbol = current_symbol.parent_symbol;
- }
-
- public override void visit_formal_parameter (FormalParameter! p) {
- if (!p.ellipsis) {
- add_symbol (p.name, p);
- }
- }
-
- public override void visit_property (Property! prop) {
- if (prop.error) {
- /* skip properties with errors */
- return;
- }
-
- if (add_symbol (prop.name, prop) == null) {
- return;
- }
-
- current_symbol = prop.symbol;
-
- prop.this_parameter = new FormalParameter ("this", new TypeReference ());
- prop.this_parameter.type_reference.data_type = (DataType) prop.symbol.parent_symbol.node;
- prop.this_parameter.symbol = new Symbol (prop.this_parameter);
- current_symbol.add (prop.this_parameter.name, prop.this_parameter.symbol);
-
- prop.accept_children (this);
-
- current_symbol = current_symbol.parent_symbol;
- }
-
- public override void visit_property_accessor (PropertyAccessor! acc) {
- acc.symbol = new Symbol (acc);
- acc.symbol.parent_symbol = current_symbol;
-
- if (acc.source_reference.file.pkg) {
- return;
- }
-
- current_symbol = acc.symbol;
-
- if (acc.writable || acc.construction) {
- acc.value_parameter = new FormalParameter ("value", ((Property) current_symbol.parent_symbol.node).type_reference);
- acc.value_parameter.symbol = new Symbol (acc.value_parameter);
-
- current_symbol.add (acc.value_parameter.name, acc.value_parameter.symbol);
- }
-
- if (acc.body == null) {
- /* no accessor body specified, insert default body */
-
- var prop = (Property) acc.symbol.parent_symbol.node;
-
- if (prop.interface_only || prop.is_abstract) {
- current_symbol = current_symbol.parent_symbol;
- return;
- }
-
- var block = new Block ();
- if (acc.readable) {
- block.add_statement (new ReturnStatement (new MemberAccess.simple ("_%s".printf (prop.name))));
- } else {
- block.add_statement (new ExpressionStatement (new Assignment (new MemberAccess.simple ("_%s".printf (prop.name)), new MemberAccess.simple ("value"))));
- }
- acc.body = block;
- }
-
- acc.accept_children (this);
-
- current_symbol = current_symbol.parent_symbol;
- }
-
- public override void visit_signal (Signal! sig) {
- if (sig.error) {
- /* skip signals with errors */
- return;
- }
-
- if (add_symbol (sig.name, sig) == null) {
- return;
- }
-
- current_symbol = sig.symbol;
-
- sig.accept_children (this);
-
- current_symbol = current_symbol.parent_symbol;
- }
-
- public override void visit_constructor (Constructor! c) {
- c.symbol = new Symbol (c);
- c.symbol.parent_symbol = current_symbol;
- current_symbol = c.symbol;
-
- c.accept_children (this);
-
- current_symbol = current_symbol.parent_symbol;
- }
-
- public override void visit_destructor (Destructor! d) {
- d.symbol = new Symbol (d);
- d.symbol.parent_symbol = current_symbol;
- current_symbol = d.symbol;
-
- d.accept_children (this);
-
- current_symbol = current_symbol.parent_symbol;
- }
-
- public override void visit_try_statement (TryStatement! stmt) {
- stmt.accept_children (this);
- }
-
- public override void visit_catch_clause (CatchClause! clause) {
- clause.accept_children (this);
- }
-
- public override void visit_begin_block (Block! b) {
- b.symbol = new Symbol (b);
- b.symbol.parent_symbol = current_symbol;
- current_symbol = b.symbol;
- }
-
- public override void visit_end_block (Block! b) {
- current_symbol = current_symbol.parent_symbol;
- }
-
- public override void visit_type_parameter (TypeParameter! p) {
- add_symbol (p.name, p);
- }
-}
-
*/
public class Vala.SymbolResolver : CodeVisitor {
Symbol root_symbol;
- Symbol current_scope;
+ Scope current_scope;
List<weak NamespaceReference> current_using_directives;
Class object_class;
*/
public void resolve (CodeContext! context) {
root_symbol = context.root;
- current_scope = root_symbol;
+ current_scope = root_symbol.scope;
// TODO: don't require GLib namespace in symbol resolver
- var glib_ns = root_symbol.lookup ("GLib");
+ var glib_ns = root_symbol.scope.lookup ("GLib");
if (glib_ns != null) {
- object_class = (Class) glib_ns.lookup ("Object").node;
+ object_class = (Class) glib_ns.scope.lookup ("Object");
}
context.accept (this);
public override void visit_source_file (SourceFile! file) {
current_using_directives = file.get_using_directives ();
- current_scope = root_symbol;
+ current_scope = root_symbol.scope;
file.accept_children (this);
}
public override void visit_class (Class! cl) {
- current_scope = cl.symbol;
+ current_scope = cl.scope;
cl.accept_children (this);
foreach (TypeReference type in cl.get_base_types ()) {
if (type.data_type is Class) {
if (cl.base_class != null) {
- Report.error (type.source_reference, "%s: Classes cannot have multiple base classes (`%s' and `%s')".printf (cl.symbol.get_full_name (), cl.base_class.symbol.get_full_name (), type.data_type.symbol.get_full_name ()));
+ Report.error (type.source_reference, "%s: Classes cannot have multiple base classes (`%s' and `%s')".printf (cl.get_full_name (), cl.base_class.get_full_name (), type.data_type.get_full_name ()));
return;
}
cl.base_class = (Class) type.data_type;
cl.base_class = object_class;
}
- current_scope = current_scope.parent_symbol;
+ current_scope = current_scope.parent_scope;
}
public override void visit_struct (Struct! st) {
- current_scope = st.symbol;
+ current_scope = st.scope;
st.accept_children (this);
- current_scope = current_scope.parent_symbol;
+ current_scope = current_scope.parent_scope;
}
public override void visit_interface (Interface! iface) {
- current_scope = iface.symbol;
+ current_scope = iface.scope;
iface.accept_children (this);
- current_scope = current_scope.parent_symbol;
+ current_scope = current_scope.parent_scope;
}
public override void visit_enum (Enum! en) {
- current_scope = en.symbol;
+ current_scope = en.scope;
en.accept_children (this);
- current_scope = current_scope.parent_symbol;
+ current_scope = current_scope.parent_scope;
}
public override void visit_callback (Callback! cb) {
- current_scope = cb.symbol;
+ current_scope = cb.scope;
cb.accept_children (this);
- current_scope = current_scope.parent_symbol;
+ current_scope = current_scope.parent_scope;
}
public override void visit_constant (Constant! c) {
+ current_scope = c.scope;
+
c.accept_children (this);
}
public override void visit_field (Field! f) {
+ current_scope = f.scope;
+
f.accept_children (this);
+
+ current_scope = current_scope.parent_scope;
}
public override void visit_method (Method! m) {
+ current_scope = m.scope;
+
m.accept_children (this);
+
+ current_scope = current_scope.parent_scope;
}
public override void visit_creation_method (CreationMethod! m) {
if (type.namespace_name == null) {
Symbol sym = null;
- Symbol scope = current_scope;
+ Scope scope = current_scope;
while (sym == null && scope != null) {
sym = scope.lookup (type.type_name);
- scope = scope.parent_symbol;
- if (sym != null && !(sym.node is DataType) && !(sym.node is TypeParameter)) {
+ scope = scope.parent_scope;
+ if (sym != null && !(sym is DataType) && !(sym is TypeParameter)) {
// ignore non-type symbols
sym = null;
}
continue;
}
- var local_sym = ns.namespace_symbol.lookup (type.type_name);
+ var local_sym = ns.namespace_symbol.scope.lookup (type.type_name);
if (local_sym != null) {
if (sym != null) {
Report.error (type.source_reference, "`%s' is an ambiguous reference between `%s' and `%s'".printf (type.type_name, sym.get_full_name (), local_sym.get_full_name ()));
Report.error (type.source_reference, "The type name `%s' could not be found".printf (type.type_name));
return;
}
- if (sym.node is TypeParameter) {
- type.type_parameter = (TypeParameter) sym.node;
+ if (sym is TypeParameter) {
+ type.type_parameter = (TypeParameter) sym;
} else {
- type.data_type = (DataType) sym.node;
+ type.data_type = (DataType) sym;
}
} else {
- var ns_symbol = root_symbol.lookup (type.namespace_name);
+ var ns_symbol = root_symbol.scope.lookup (type.namespace_name);
if (ns_symbol == null) {
type.error = true;
Report.error (type.source_reference, "The namespace name `%s' could not be found".printf (type.namespace_name));
return;
}
- var sym = ns_symbol.lookup (type.type_name);
+ var sym = ns_symbol.scope.lookup (type.type_name);
if (sym == null) {
Report.error (type.source_reference, "The type name `%s' does not exist in the namespace `%s'".printf (type.type_name, type.namespace_name));
return;
}
- type.data_type = (DataType) sym.node;
+ type.data_type = (DataType) sym;
}
if (type.pointer_level > 0) {
/**
* Represents a throw statement in the source code.
*/
-public class Vala.ThrowStatement : Statement {
+public class Vala.ThrowStatement : CodeNode, Statement {
/**
* The error expression to throw.
*/
/**
* Represents a try statement in the source code.
*/
-public class Vala.TryStatement : Statement {
+public class Vala.TryStatement : CodeNode, Statement {
/**
* Specifies the body of the try statement.
*/
/**
* Represents a generic type parameter in the source code.
*/
-public class Vala.TypeParameter : CodeNode {
- /**
- * The parameter name.
- */
- public string! name { get; set construct; }
-
+public class Vala.TypeParameter : Symbol {
/**
* The generic type declaring this parameter.
*/
if (array_type == null) {
var new_array_type = new Array.with_type_parameter (this, rank, source_reference);
- /* create a new Symbol */
- new_array_type.symbol = new Symbol (new_array_type);
- this.symbol.parent_symbol.add (new_array_type.name, new_array_type.symbol);
+ parent_symbol.scope.add (new_array_type.name, new_array_type);
/* add internal length field */
- new_array_type.symbol.add (new_array_type.get_length_field ().name, new_array_type.get_length_field ().symbol);
+ new_array_type.scope.add (new_array_type.get_length_field ().name, new_array_type.get_length_field ());
/* add internal resize method */
- new_array_type.symbol.add (new_array_type.get_resize_method ().name, new_array_type.get_resize_method ().symbol);
+ new_array_type.scope.add (new_array_type.get_resize_method ().name, new_array_type.get_resize_method ());
/* link the array type to the same source as the container type */
new_array_type.source_reference = this.source_reference;
*/
public string! to_string () {
if (data_type != null) {
- return data_type.symbol.get_full_name ();
+ return data_type.get_full_name ();
} else if (type_parameter != null) {
return type_parameter.name;
} else {
/**
* Represents a variable declarator in the source code.
*/
-public class Vala.VariableDeclarator : CodeNode, Invokable {
- /**
- * The variable name.
- */
- public string! name { get; set construct; }
-
+public class Vala.VariableDeclarator : Symbol, Invokable {
/**
* The optional initializer expression.
*/
* @param source reference to source code
* @return newly created variable declarator
*/
- public VariableDeclarator (string! _name, Expression init = null, SourceReference source = null) {
- name = _name;
- initializer = init;
- source_reference = source;
+ public VariableDeclarator (construct string! name, construct Expression initializer = null, construct SourceReference source_reference = null) {
}
public override void accept (CodeVisitor! visitor) {
/* valawhilestatement.vala
*
- * Copyright (C) 2006 Jürg Billeter
+ * Copyright (C) 2006-2007 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
/**
* Represents a while iteration statement in the source code.
*/
-public class Vala.WhileStatement : Statement {
+public class Vala.WhileStatement : CodeNode, Statement {
/**
* Specifies the loop condition.
*/
/**
* Specifies the loop body.
*/
- public Statement body { get; set; }
+ public Block body { get; set; }
private Expression! _condition;
* @param source reference to source code
* @return newly created while statement
*/
- public WhileStatement (Expression! cond, Statement! _body, SourceReference source) {
- condition = cond;
- body = _body;
- source_reference = source;
+ public WhileStatement (construct Expression! condition, construct Block! body, construct SourceReference source_reference = null) {
}
public override void accept (CodeVisitor! visitor) {
-[CCode (cprefix = "Atk", lower_case_cprefix = "atk_", cheader_filename = "atk/atk.h")]
+[CCode (cprefix = "Atk", lower_case_cprefix = "atk_")]
namespace Atk {
- [CCode (cprefix = "ATK_XY_")]
+ [CCode (cprefix = "ATK_XY_", cheader_filename = "atk/atk.h")]
public enum CoordType {
SCREEN,
WINDOW,
}
- [CCode (cprefix = "ATK_HYPERLINK_IS_")]
+ [CCode (cprefix = "ATK_HYPERLINK_IS_", cheader_filename = "atk/atk.h")]
public enum HyperlinkStateFlags {
INLINE,
}
- [CCode (cprefix = "ATK_KEY_EVENT_")]
+ [CCode (cprefix = "ATK_KEY_EVENT_", cheader_filename = "atk/atk.h")]
public enum KeyEventType {
PRESS,
RELEASE,
LAST_DEFINED,
}
- [CCode (cprefix = "ATK_LAYER_")]
+ [CCode (cprefix = "ATK_LAYER_", cheader_filename = "atk/atk.h")]
public enum Layer {
INVALID,
BACKGROUND,
OVERLAY,
WINDOW,
}
- [CCode (cprefix = "ATK_RELATION_")]
+ [CCode (cprefix = "ATK_RELATION_", cheader_filename = "atk/atk.h")]
public enum RelationType {
NULL,
CONTROLLED_BY,
DESCRIPTION_FOR,
LAST_DEFINED,
}
- [CCode (cprefix = "ATK_ROLE_")]
+ [CCode (cprefix = "ATK_ROLE_", cheader_filename = "atk/atk.h")]
public enum Role {
INVALID,
ACCEL_LABEL,
INPUT_METHOD_WINDOW,
LAST_DEFINED,
}
- [CCode (cprefix = "ATK_STATE_")]
+ [CCode (cprefix = "ATK_STATE_", cheader_filename = "atk/atk.h")]
public enum StateType {
INVALID,
ACTIVE,
VISITED,
LAST_DEFINED,
}
- [CCode (cprefix = "ATK_TEXT_ATTR_")]
+ [CCode (cprefix = "ATK_TEXT_ATTR_", cheader_filename = "atk/atk.h")]
public enum TextAttribute {
INVALID,
LEFT_MARGIN,
STYLE,
LAST_DEFINED,
}
- [CCode (cprefix = "ATK_TEXT_BOUNDARY_")]
+ [CCode (cprefix = "ATK_TEXT_BOUNDARY_", cheader_filename = "atk/atk.h")]
public enum TextBoundary {
CHAR,
WORD_START,
LINE_START,
LINE_END,
}
- [CCode (cprefix = "ATK_TEXT_CLIP_")]
+ [CCode (cprefix = "ATK_TEXT_CLIP_", cheader_filename = "atk/atk.h")]
public enum TextClipType {
NONE,
MIN,
public virtual bool set_current_value (GLib.Value value);
}
[ReferenceType]
+ [CCode (cheader_filename = "atk/atk.h")]
public struct Attribute {
public weak string name;
public weak string value;
public static void set_free (GLib.SList attrib_set);
}
[ReferenceType]
+ [CCode (cheader_filename = "atk/atk.h")]
public struct KeyEventStruct {
public int type;
public uint state;
public uint timestamp;
}
[ReferenceType]
+ [CCode (cheader_filename = "atk/atk.h")]
public struct PropertyValues {
public weak string property_name;
public weak GLib.Value old_value;
public weak GLib.Value new_value;
}
+ [CCode (cheader_filename = "atk/atk.h")]
public struct Rectangle {
public int x;
public int y;
public static GLib.Type get_type ();
}
[ReferenceType]
+ [CCode (cheader_filename = "atk/atk.h")]
public struct TextRange {
public weak Atk.TextRectangle bounds;
public int start_offset;
public weak string content;
}
[ReferenceType]
+ [CCode (cheader_filename = "atk/atk.h")]
public struct TextRectangle {
public int x;
public int y;
public int height;
}
[ReferenceType]
+ [CCode (cheader_filename = "atk/atk.h")]
public struct Focus {
public static void tracker_init (Atk.EventListenerInit init);
public static void tracker_notify (Atk.Object object);
}
[ReferenceType]
+ [CCode (cheader_filename = "atk/atk.h")]
public struct State {
public static Atk.StateType type_for_name (string name);
public static weak string type_get_name (Atk.StateType type);
-[CCode (cprefix = "Gdk", lower_case_cprefix = "gdk_", cheader_filename = "gdk/gdk.h")]
+[CCode (cprefix = "Gdk", lower_case_cprefix = "gdk_")]
namespace Gdk {
- [CCode (cprefix = "GDK_AXIS_")]
+ [CCode (cprefix = "GDK_AXIS_", cheader_filename = "gdk/gdk.h")]
public enum AxisUse {
IGNORE,
X,
WHEEL,
LAST,
}
- [CCode (cprefix = "GDK_")]
+ [CCode (cprefix = "GDK_", cheader_filename = "gdk/gdk.h")]
public enum ByteOrder {
LSB_FIRST,
MSB_FIRST,
}
- [CCode (cprefix = "GDK_CAP_")]
+ [CCode (cprefix = "GDK_CAP_", cheader_filename = "gdk/gdk.h")]
public enum CapStyle {
NOT_LAST,
BUTT,
ROUND,
PROJECTING,
}
- [CCode (cprefix = "GDK_COLORSPACE_")]
+ [CCode (cprefix = "GDK_COLORSPACE_", cheader_filename = "gdk/gdk.h")]
public enum Colorspace {
RGB,
}
- [CCode (cprefix = "GDK_CROSSING_")]
+ [CCode (cprefix = "GDK_CROSSING_", cheader_filename = "gdk/gdk.h")]
public enum CrossingMode {
NORMAL,
GRAB,
UNGRAB,
}
- [CCode (cprefix = "GDK_")]
+ [CCode (cprefix = "GDK_", cheader_filename = "gdk/gdk.h")]
public enum CursorType {
X_CURSOR,
ARROW,
LAST_CURSOR,
CURSOR_IS_PIXMAP,
}
- [CCode (cprefix = "GDK_ACTION_")]
+ [CCode (cprefix = "GDK_ACTION_", cheader_filename = "gdk/gdk.h")]
public enum DragAction {
DEFAULT,
COPY,
PRIVATE,
ASK,
}
- [CCode (cprefix = "GDK_DRAG_PROTO_")]
+ [CCode (cprefix = "GDK_DRAG_PROTO_", cheader_filename = "gdk/gdk.h")]
public enum DragProtocol {
MOTIF,
XDND,
OLE2,
LOCAL,
}
- [CCode (cprefix = "GDK_")]
+ [CCode (cprefix = "GDK_", cheader_filename = "gdk/gdk.h")]
public enum EventMask {
EXPOSURE_MASK,
POINTER_MOTION_MASK,
SCROLL_MASK,
ALL_EVENTS_MASK,
}
- [CCode (cprefix = "GDK_")]
+ [CCode (cprefix = "GDK_", cheader_filename = "gdk/gdk.h")]
public enum EventType {
NOTHING,
DELETE,
OWNER_CHANGE,
GRAB_BROKEN,
}
- [CCode (cprefix = "GDK_EXTENSION_EVENTS_")]
+ [CCode (cprefix = "GDK_EXTENSION_EVENTS_", cheader_filename = "gdk/gdk.h")]
public enum ExtensionMode {
NONE,
ALL,
CURSOR,
}
- [CCode (cprefix = "GDK_")]
+ [CCode (cprefix = "GDK_", cheader_filename = "gdk/gdk.h")]
public enum Fill {
SOLID,
TILED,
STIPPLED,
OPAQUE_STIPPLED,
}
- [CCode (cprefix = "GDK_")]
+ [CCode (cprefix = "GDK_", cheader_filename = "gdk/gdk.h")]
public enum FillRule {
EVEN_ODD_RULE,
WINDING_RULE,
}
- [CCode (cprefix = "GDK_FILTER_")]
+ [CCode (cprefix = "GDK_FILTER_", cheader_filename = "gdk/gdk.h")]
public enum FilterReturn {
CONTINUE,
TRANSLATE,
REMOVE,
}
- [CCode (cprefix = "GDK_FONT_")]
+ [CCode (cprefix = "GDK_FONT_", cheader_filename = "gdk/gdk.h")]
public enum FontType {
FONT,
FONTSET,
}
- [CCode (cprefix = "GDK_")]
+ [CCode (cprefix = "GDK_", cheader_filename = "gdk/gdk.h")]
public enum Function {
COPY,
INVERT,
NOR,
SET,
}
- [CCode (cprefix = "GDK_GC_")]
+ [CCode (cprefix = "GDK_GC_", cheader_filename = "gdk/gdk.h")]
public enum GCValuesMask {
FOREGROUND,
BACKGROUND,
CAP_STYLE,
JOIN_STYLE,
}
- [CCode (cprefix = "GDK_GRAB_")]
+ [CCode (cprefix = "GDK_GRAB_", cheader_filename = "gdk/gdk.h")]
public enum GrabStatus {
SUCCESS,
ALREADY_GRABBED,
NOT_VIEWABLE,
FROZEN,
}
- [CCode (cprefix = "GDK_GRAVITY_")]
+ [CCode (cprefix = "GDK_GRAVITY_", cheader_filename = "gdk/gdk.h")]
public enum Gravity {
NORTH_WEST,
NORTH,
SOUTH_EAST,
STATIC,
}
- [CCode (cprefix = "GDK_IMAGE_")]
+ [CCode (cprefix = "GDK_IMAGE_", cheader_filename = "gdk/gdk.h")]
public enum ImageType {
NORMAL,
SHARED,
FASTEST,
}
- [CCode (cprefix = "GDK_INPUT_")]
+ [CCode (cprefix = "GDK_INPUT_", cheader_filename = "gdk/gdk.h")]
public enum InputCondition {
READ,
WRITE,
EXCEPTION,
}
- [CCode (cprefix = "GDK_MODE_")]
+ [CCode (cprefix = "GDK_MODE_", cheader_filename = "gdk/gdk.h")]
public enum InputMode {
DISABLED,
SCREEN,
WINDOW,
}
- [CCode (cprefix = "GDK_SOURCE_")]
+ [CCode (cprefix = "GDK_SOURCE_", cheader_filename = "gdk/gdk.h")]
public enum InputSource {
MOUSE,
PEN,
ERASER,
CURSOR,
}
- [CCode (cprefix = "GDK_INTERP_")]
+ [CCode (cprefix = "GDK_INTERP_", cheader_filename = "gdk/gdk.h")]
public enum InterpType {
NEAREST,
TILES,
BILINEAR,
HYPER,
}
- [CCode (cprefix = "GDK_JOIN_")]
+ [CCode (cprefix = "GDK_JOIN_", cheader_filename = "gdk/gdk.h")]
public enum JoinStyle {
MITER,
ROUND,
BEVEL,
}
- [CCode (cprefix = "GDK_LINE_")]
+ [CCode (cprefix = "GDK_LINE_", cheader_filename = "gdk/gdk.h")]
public enum LineStyle {
SOLID,
ON_OFF_DASH,
DOUBLE_DASH,
}
- [CCode (cprefix = "GDK_")]
+ [CCode (cprefix = "GDK_", cheader_filename = "gdk/gdk.h")]
public enum ModifierType {
SHIFT_MASK,
LOCK_MASK,
RELEASE_MASK,
MODIFIER_MASK,
}
- [CCode (cprefix = "GDK_NOTIFY_")]
+ [CCode (cprefix = "GDK_NOTIFY_", cheader_filename = "gdk/gdk.h")]
public enum NotifyType {
ANCESTOR,
VIRTUAL,
NONLINEAR_VIRTUAL,
UNKNOWN,
}
- [CCode (cprefix = "GDK_OVERLAP_RECTANGLE_")]
+ [CCode (cprefix = "GDK_OVERLAP_RECTANGLE_", cheader_filename = "gdk/gdk.h")]
public enum OverlapType {
IN,
OUT,
PART,
}
- [CCode (cprefix = "GDK_OWNER_CHANGE_")]
+ [CCode (cprefix = "GDK_OWNER_CHANGE_", cheader_filename = "gdk/gdk.h")]
public enum OwnerChange {
NEW_OWNER,
DESTROY,
CLOSE,
}
- [CCode (cprefix = "GDK_PIXBUF_ALPHA_")]
+ [CCode (cprefix = "GDK_PIXBUF_ALPHA_", cheader_filename = "gdk/gdk.h")]
public enum PixbufAlphaMode {
BILEVEL,
FULL,
}
- [CCode (cprefix = "GDK_PIXBUF_ERROR_")]
+ [CCode (cprefix = "GDK_PIXBUF_ERROR_", cheader_filename = "gdk/gdk.h")]
public enum PixbufError {
CORRUPT_IMAGE,
INSUFFICIENT_MEMORY,
UNSUPPORTED_OPERATION,
FAILED,
}
- [CCode (cprefix = "GDK_PIXBUF_FRAME_")]
+ [CCode (cprefix = "GDK_PIXBUF_FRAME_", cheader_filename = "gdk/gdk.h")]
public enum PixbufFrameAction {
RETAIN,
DISPOSE,
REVERT,
}
- [CCode (cprefix = "GDK_PIXBUF_ROTATE_")]
+ [CCode (cprefix = "GDK_PIXBUF_ROTATE_", cheader_filename = "gdk/gdk.h")]
public enum PixbufRotation {
NONE,
COUNTERCLOCKWISE,
UPSIDEDOWN,
CLOCKWISE,
}
- [CCode (cprefix = "GDK_PIXDATA_DUMP_")]
+ [CCode (cprefix = "GDK_PIXDATA_DUMP_", cheader_filename = "gdk/gdk.h")]
public enum PixdataDumpType {
PIXDATA_STREAM,
PIXDATA_STRUCT,
CONST,
RLE_DECODER,
}
- [CCode (cprefix = "GDK_PIXDATA_")]
+ [CCode (cprefix = "GDK_PIXDATA_", cheader_filename = "gdk/gdk.h")]
public enum PixdataType {
COLOR_TYPE_RGB,
COLOR_TYPE_RGBA,
ENCODING_RLE,
ENCODING_MASK,
}
- [CCode (cprefix = "GDK_PROP_MODE_")]
+ [CCode (cprefix = "GDK_PROP_MODE_", cheader_filename = "gdk/gdk.h")]
public enum PropMode {
REPLACE,
PREPEND,
APPEND,
}
- [CCode (cprefix = "GDK_PROPERTY_")]
+ [CCode (cprefix = "GDK_PROPERTY_", cheader_filename = "gdk/gdk.h")]
public enum PropertyState {
NEW_VALUE,
DELETE,
}
- [CCode (cprefix = "GDK_RGB_DITHER_")]
+ [CCode (cprefix = "GDK_RGB_DITHER_", cheader_filename = "gdk/gdk.h")]
public enum RgbDither {
NONE,
NORMAL,
MAX,
}
- [CCode (cprefix = "GDK_SCROLL_")]
+ [CCode (cprefix = "GDK_SCROLL_", cheader_filename = "gdk/gdk.h")]
public enum ScrollDirection {
UP,
DOWN,
LEFT,
RIGHT,
}
- [CCode (cprefix = "GDK_SETTING_ACTION_")]
+ [CCode (cprefix = "GDK_SETTING_ACTION_", cheader_filename = "gdk/gdk.h")]
public enum SettingAction {
NEW,
CHANGED,
DELETED,
}
- [CCode (cprefix = "GDK_")]
+ [CCode (cprefix = "GDK_", cheader_filename = "gdk/gdk.h")]
public enum Status {
OK,
ERROR,
ERROR_FILE,
ERROR_MEM,
}
- [CCode (cprefix = "GDK_")]
+ [CCode (cprefix = "GDK_", cheader_filename = "gdk/gdk.h")]
public enum SubwindowMode {
CLIP_BY_CHILDREN,
INCLUDE_INFERIORS,
}
- [CCode (cprefix = "GDK_VISIBILITY_")]
+ [CCode (cprefix = "GDK_VISIBILITY_", cheader_filename = "gdk/gdk.h")]
public enum VisibilityState {
UNOBSCURED,
PARTIAL,
FULLY_OBSCURED,
}
- [CCode (cprefix = "GDK_VISUAL_")]
+ [CCode (cprefix = "GDK_VISUAL_", cheader_filename = "gdk/gdk.h")]
public enum VisualType {
STATIC_GRAY,
GRAYSCALE,
TRUE_COLOR,
DIRECT_COLOR,
}
- [CCode (cprefix = "GDK_DECOR_")]
+ [CCode (cprefix = "GDK_DECOR_", cheader_filename = "gdk/gdk.h")]
public enum WMDecoration {
ALL,
BORDER,
MINIMIZE,
MAXIMIZE,
}
- [CCode (cprefix = "GDK_FUNC_")]
+ [CCode (cprefix = "GDK_FUNC_", cheader_filename = "gdk/gdk.h")]
public enum WMFunction {
ALL,
RESIZE,
MAXIMIZE,
CLOSE,
}
- [CCode (cprefix = "GDK_WA_")]
+ [CCode (cprefix = "GDK_WA_", cheader_filename = "gdk/gdk.h")]
public enum WindowAttributesType {
TITLE,
X,
NOREDIR,
TYPE_HINT,
}
- [CCode (cprefix = "GDK_INPUT_")]
+ [CCode (cprefix = "GDK_INPUT_", cheader_filename = "gdk/gdk.h")]
public enum WindowClass {
OUTPUT,
ONLY,
}
- [CCode (cprefix = "GDK_WINDOW_EDGE_")]
+ [CCode (cprefix = "GDK_WINDOW_EDGE_", cheader_filename = "gdk/gdk.h")]
public enum WindowEdge {
NORTH_WEST,
NORTH,
SOUTH,
SOUTH_EAST,
}
- [CCode (cprefix = "GDK_HINT_")]
+ [CCode (cprefix = "GDK_HINT_", cheader_filename = "gdk/gdk.h")]
public enum WindowHints {
POS,
MIN_SIZE,
USER_POS,
USER_SIZE,
}
- [CCode (cprefix = "GDK_WINDOW_STATE_")]
+ [CCode (cprefix = "GDK_WINDOW_STATE_", cheader_filename = "gdk/gdk.h")]
public enum WindowState {
WITHDRAWN,
ICONIFIED,
ABOVE,
BELOW,
}
- [CCode (cprefix = "GDK_WINDOW_")]
+ [CCode (cprefix = "GDK_WINDOW_", cheader_filename = "gdk/gdk.h")]
public enum WindowType {
ROOT,
TOPLEVEL,
TEMP,
FOREIGN,
}
- [CCode (cprefix = "GDK_WINDOW_TYPE_HINT_")]
+ [CCode (cprefix = "GDK_WINDOW_TYPE_HINT_", cheader_filename = "gdk/gdk.h")]
public enum WindowTypeHint {
NORMAL,
DIALOG,
public void clear_area (int x, int y, int width, int height);
public void clear_area_e (int x, int y, int width, int height);
public void configure_finished ();
- public static void constrain_size (Gdk.Geometry geometry, uint @flags, int width, int height, int new_width, int new_height);
+ public static void constrain_size (Gdk.Geometry geometry, uint flags, int width, int height, int new_width, int new_height);
public void deiconify ();
public void destroy ();
public void enable_synchronized_configure ();
public static weak Gdk.Bitmap create_from_data (Gdk.Drawable drawable, string data, int width, int height);
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct BRESINFO {
public int minor_axis;
public int d;
public int incr2;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct EdgeTable {
public int ymax;
public int ymin;
public weak Gdk.ScanLineList scanlines;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct EdgeTableEntry {
}
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Color {
public uint pixel;
public ushort red;
public weak string to_string ();
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Cursor {
public Gdk.CursorType type;
public weak Gdk.Display get_display ();
public void unref ();
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct DeviceAxis {
public Gdk.AxisUse use;
public double min;
public double max;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct DeviceKey {
public uint keyval;
public Gdk.ModifierType modifiers;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct DisplayPointerHooks {
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct EventAny {
public Gdk.EventType type;
public weak Gdk.Window window;
public char send_event;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct EventButton {
public Gdk.EventType type;
public weak Gdk.Window window;
public double y_root;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct EventClient {
public Gdk.EventType type;
public weak Gdk.Window window;
public char b;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct EventConfigure {
public Gdk.EventType type;
public weak Gdk.Window window;
public int height;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct EventCrossing {
public Gdk.EventType type;
public weak Gdk.Window window;
public uint state;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct EventDND {
public Gdk.EventType type;
public weak Gdk.Window window;
public short y_root;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct EventExpose {
public Gdk.EventType type;
public weak Gdk.Window window;
public int count;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct EventFocus {
public Gdk.EventType type;
public weak Gdk.Window window;
public short @in;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct EventGrabBroken {
public Gdk.EventType type;
public weak Gdk.Window window;
public weak Gdk.Window grab_window;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct EventKey {
public Gdk.EventType type;
public weak Gdk.Window window;
public uint is_modifier;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct EventMotion {
public Gdk.EventType type;
public weak Gdk.Window window;
public double y_root;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct EventNoExpose {
public Gdk.EventType type;
public weak Gdk.Window window;
public char send_event;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct EventOwnerChange {
public Gdk.EventType type;
public weak Gdk.Window window;
public uint selection_time;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct EventProperty {
public Gdk.EventType type;
public weak Gdk.Window window;
public uint state;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct EventProximity {
public Gdk.EventType type;
public weak Gdk.Window window;
public weak Gdk.Device device;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct EventScroll {
public Gdk.EventType type;
public weak Gdk.Window window;
public double y_root;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct EventSelection {
public Gdk.EventType type;
public weak Gdk.Window window;
public pointer requestor;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct EventSetting {
public Gdk.EventType type;
public weak Gdk.Window window;
public weak string name;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct EventVisibility {
public Gdk.EventType type;
public weak Gdk.Window window;
public Gdk.VisibilityState state;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct EventWindowState {
public Gdk.EventType type;
public weak Gdk.Window window;
public Gdk.WindowState new_window_state;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Font {
public Gdk.FontType type;
public int ascent;
public int descent;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct GCValues {
public Gdk.Color foreground;
public Gdk.Color background;
public Gdk.JoinStyle join_style;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Geometry {
public int min_width;
public int min_height;
public Gdk.Gravity win_gravity;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct KeymapKey {
public uint keycode;
public int group;
public int level;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct PangoAttrEmbossColor {
public weak Pango.Attribute attr;
public Pango.Color color;
public PangoAttrEmbossColor (out Gdk.Color color);
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct PangoAttrEmbossed {
public weak Pango.Attribute attr;
public bool embossed;
public PangoAttrEmbossed (bool embossed);
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct PangoAttrStipple {
public weak Pango.Attribute attr;
public weak Gdk.Bitmap stipple;
public PangoAttrStipple (Gdk.Bitmap stipple);
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct PixbufFormat {
public weak string get_description ();
public weak string get_extensions ();
public void set_disabled (bool disabled);
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct PixbufFrame {
public weak Gdk.Pixbuf pixbuf;
public int x_offset;
public weak Gdk.Pixbuf revert;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct PixbufScaledAnim {
public static GLib.Type get_type ();
public static GLib.Type iter_get_type ();
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct PixbufScaledAnimClass {
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Pixdata {
public uint magic;
public int length;
public weak GLib.String to_csource (string name, Gdk.PixdataDumpType dump_type);
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct PixmapObject {
public weak Gdk.Drawable parent_instance;
public weak Gdk.Drawable impl;
public int depth;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Point {
public int x;
public int y;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct PointerHooks {
}
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Rectangle {
public int x;
public int y;
public void union (out Gdk.Rectangle src2, out Gdk.Rectangle dest);
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Region {
public long size;
public long numRects;
public void xor (Gdk.Region source2);
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct RegionBox {
public int x1;
public int y1;
public int y2;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct RgbCmap {
public uint colors;
public int n_colors;
public RgbCmap (uint[] colors, int n_colors);
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Segment {
public int x1;
public int y1;
public int y2;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Span {
public int x;
public int y;
public int width;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct TimeCoord {
public uint time;
public double axes;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Trapezoid {
public double y1;
public double x11;
public double x12;
public double x22;
}
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct WindowAttr {
public weak string title;
public int event_mask;
public Gdk.WindowTypeHint type_hint;
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct WindowObject {
public weak Gdk.Drawable parent_instance;
public weak Gdk.Drawable impl;
public static GLib.Type get_type ();
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct POINTBLOCK {
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct ScanLineList {
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct ScanLineListBlock {
}
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Atom {
public static Gdk.Atom intern (string atom_name, bool only_if_exists);
public static Gdk.Atom intern_static_string (string atom_name);
public weak string name ();
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Cairo {
public static weak Cairo.Context create (Gdk.Drawable drawable);
public static void rectangle (Cairo.Context cr, out Gdk.Rectangle rectangle);
public static void set_source_pixmap (Cairo.Context cr, Gdk.Pixmap pixmap, double pixmap_x, double pixmap_y);
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Char {
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Colors {
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Drag {
public static void abort (Gdk.DragContext context, uint time_);
public static weak Gdk.DragContext begin (Gdk.Window window, GLib.List targets);
public static void status (Gdk.DragContext context, Gdk.DragAction action, uint time_);
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Drop {
public static void finish (Gdk.DragContext context, bool success, uint time_);
public static void reply (Gdk.DragContext context, bool ok, uint time_);
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Error {
public static int trap_pop ();
public static void trap_push ();
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Event {
public weak Gdk.Event copy ();
public void free ();
public void set_screen (Gdk.Screen screen);
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Fontset {
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Input {
public static void set_extension_events (Gdk.Window window, int mask, Gdk.ExtensionMode mode);
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Keyboard {
public static Gdk.GrabStatus grab (Gdk.Window window, bool owner_events, uint time_);
public static bool grab_info_libgtk_only (Gdk.Display display, Gdk.Window grab_window, bool owner_events);
public static void ungrab (uint time_);
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Keyval {
public static void convert_case (uint symbol, uint lower, uint upper);
public static uint from_name (string keyval_name);
public static uint to_upper (uint keyval);
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Notify {
public static void startup_complete ();
public static void startup_complete_with_id (string startup_id);
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Pango {
public static weak Pango.Context context_get ();
public static weak Pango.Context context_get_for_screen (Gdk.Screen screen);
public static weak Gdk.Region layout_line_get_clip_region (Pango.LayoutLine line, int x_origin, int y_origin, int index_ranges, int n_ranges);
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Pointer {
public static Gdk.GrabStatus grab (Gdk.Window window, bool owner_events, Gdk.EventMask event_mask, Gdk.Window confine_to, Gdk.Cursor cursor, uint time_);
public static bool grab_info_libgtk_only (Gdk.Display display, Gdk.Window grab_window, bool owner_events);
public static void ungrab (uint time_);
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Property {
[NoArrayLength]
public static void change (Gdk.Window window, Gdk.Atom property, Gdk.Atom type, int format, Gdk.PropMode mode, uchar[] data, int nelements);
public static bool get (Gdk.Window window, Gdk.Atom property, Gdk.Atom type, ulong offset, ulong length, int pdelete, out Gdk.Atom actual_property_type, int actual_format, int actual_length, uchar[] data);
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Query {
public static void depths (int depths, int count);
public static void visual_types (Gdk.VisualType visual_types, int count);
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Rgb {
public static bool colormap_ditherable (Gdk.Colormap cmap);
public static bool ditherable ();
public static void set_verbose (bool verbose);
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Selection {
public static void convert (Gdk.Window requestor, Gdk.Atom selection, Gdk.Atom target, uint time_);
public static weak Gdk.Window owner_get (Gdk.Atom selection);
public static void send_notify_for_display (Gdk.Display display, uint requestor, Gdk.Atom selection, Gdk.Atom target, Gdk.Atom property, uint time_);
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Spawn {
public static bool command_line_on_screen (Gdk.Screen screen, string command_line, GLib.Error error);
- public static bool on_screen (Gdk.Screen screen, string working_directory, string argv, string envp, GLib.SpawnFlags @flags, GLib.SpawnChildSetupFunc child_setup, pointer user_data, int child_pid, GLib.Error error);
- public static bool on_screen_with_pipes (Gdk.Screen screen, string working_directory, string argv, string envp, GLib.SpawnFlags @flags, GLib.SpawnChildSetupFunc child_setup, pointer user_data, int child_pid, int standard_input, int standard_output, int standard_error, GLib.Error error);
+ public static bool on_screen (Gdk.Screen screen, string working_directory, string argv, string envp, GLib.SpawnFlags flags, GLib.SpawnChildSetupFunc child_setup, pointer user_data, int child_pid, GLib.Error error);
+ public static bool on_screen_with_pipes (Gdk.Screen screen, string working_directory, string argv, string envp, GLib.SpawnFlags flags, GLib.SpawnChildSetupFunc child_setup, pointer user_data, int child_pid, int standard_input, int standard_output, int standard_error, GLib.Error error);
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Text {
[NoArrayLength]
public static int property_to_text_list (Gdk.Atom encoding, int format, uchar[] text, int length, string list);
public static int property_to_utf8_list_for_display (Gdk.Display display, Gdk.Atom encoding, int format, uchar[] text, int length, string list);
}
[ReferenceType]
+ [CCode (cheader_filename = "gdk/gdk.h")]
public struct Threads {
public static uint add_idle (GLib.SourceFunc function, pointer data);
public static uint add_idle_full (int priority, GLib.SourceFunc function, pointer data, GLib.DestroyNotify notify);
-[CCode (cprefix = "G", lower_case_cprefix = "g_", cheader_filename = "gio/gvfs.h")]
+[CCode (cprefix = "G", lower_case_cprefix = "g_")]
namespace GLib {
- [CCode (cprefix = "G_DIRECTORY_MONITOR_EVENT_")]
+ [CCode (cprefix = "G_DIRECTORY_MONITOR_EVENT_", cheader_filename = "gio/gvfs.h, glib.h")]
public enum DirectoryMonitorEvent {
CHANGED,
DELETED,
ATTRIBUTE_CHANGED,
UNMOUNTED,
}
- [CCode (cprefix = "G_FILE_ATTRIBUTE_TYPE_")]
+ [CCode (cprefix = "G_FILE_ATTRIBUTE_TYPE_", cheader_filename = "gio/gvfs.h, glib.h")]
public enum FileAttributeType {
INVALID,
STRING,
UINT64,
INT64,
}
- [CCode (cprefix = "G_FILE_COPY_")]
+ [CCode (cprefix = "G_FILE_COPY_", cheader_filename = "gio/gvfs.h, glib.h")]
public enum FileCopyFlags {
OVERWRITE,
BACKUP,
}
- [CCode (cprefix = "G_FILE_FLAG_")]
+ [CCode (cprefix = "G_FILE_FLAG_", cheader_filename = "gio/gvfs.h, glib.h")]
public enum FileFlags {
HIDDEN,
SYMLINK,
LOCAL,
VIRTUAL,
}
- [CCode (cprefix = "G_FILE_GET_INFO_NOFOLLOW_")]
+ [CCode (cprefix = "G_FILE_GET_INFO_NOFOLLOW_", cheader_filename = "gio/gvfs.h, glib.h")]
public enum FileGetInfoFlags {
SYMLINKS,
}
- [CCode (cprefix = "G_FILE_MONITOR_EVENT_")]
+ [CCode (cprefix = "G_FILE_MONITOR_EVENT_", cheader_filename = "gio/gvfs.h, glib.h")]
public enum FileMonitorEvent {
CHANGED,
DELETED,
ATTRIBUTE_CHANGED,
UNMOUNTED,
}
- [CCode (cprefix = "G_FILE_TYPE_")]
+ [CCode (cprefix = "G_FILE_TYPE_", cheader_filename = "gio/gvfs.h, glib.h")]
public enum FileType {
UNKNOWN,
REGULAR,
SHORTCUT,
MOUNTABLE,
}
- [CCode (cprefix = "G_IO_ERROR_")]
+ [CCode (cprefix = "G_IO_ERROR_", cheader_filename = "gio/gvfs.h, glib.h")]
public enum IOErrorEnum {
FAILED,
NOT_FOUND,
WRONG_MTIME,
TIMED_OUT,
}
- [CCode (cprefix = "G_PASSWORD_FLAGS_")]
+ [CCode (cprefix = "G_PASSWORD_FLAGS_", cheader_filename = "gio/gvfs.h, glib.h")]
public enum PasswordFlags {
NEED_PASSWORD,
NEED_USERNAME,
SAVING_SUPPORTED,
ANON_SUPPORTED,
}
- [CCode (cprefix = "G_PASSWORD_SAVE_")]
+ [CCode (cprefix = "G_PASSWORD_SAVE_", cheader_filename = "gio/gvfs.h, glib.h")]
public enum PasswordSave {
NEVER,
FOR_SESSION,
PERMANENTLY,
}
- [CCode (cprefix = "G_UNIX_MOUNT_TYPE_")]
+ [CCode (cprefix = "G_UNIX_MOUNT_TYPE_", cheader_filename = "gio/gvfs.h, glib.h")]
public enum UnixMountType {
UNKNOWN,
FLOPPY,
CAMERA,
HD,
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class BufferedInputStream : GLib.FilterInputStream {
public static GLib.Type get_type ();
public BufferedInputStream (GLib.InputStream base_stream);
[NoAccessorMethod]
public weak uint buffer_size { get; construct; }
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class BufferedOutputStream : GLib.FilterOutputStream {
public static GLib.Type get_type ();
public BufferedOutputStream (GLib.OutputStream base_stream);
[NoAccessorMethod]
public weak uint buffer_size { get; construct; }
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class Cancellable : GLib.Object {
public void cancel ();
public int get_fd ();
public void reset ();
public signal void cancelled ();
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class DesktopAppInfo : GLib.Object, GLib.AppInfo {
public static GLib.Type get_type ();
public DesktopAppInfo (string desktop_id);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class DirectoryMonitor : GLib.Object {
public virtual bool cancel ();
public void emit_event (GLib.File child, GLib.File other_file, GLib.DirectoryMonitorEvent event_type);
public void set_rate_limit (int limit_msecs);
public signal void changed (GLib.File child, GLib.File other_file, GLib.DirectoryMonitorEvent event_type);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class FileEnumerator : GLib.Object {
public static GLib.Type get_type ();
public bool has_pending ();
public bool is_stopped ();
public virtual weak GLib.FileInfo next_file (GLib.Cancellable cancellable, GLib.Error error);
- public virtual void next_files_async (int num_files, int io_priority, GLib.AsyncNextFilesCallback @callback, pointer user_data, GLib.Cancellable cancellable);
+ public virtual void next_files_async (int num_files, int io_priority, GLib.AsyncNextFilesCallback callback, pointer user_data, GLib.Cancellable cancellable);
public void set_pending (bool pending);
public virtual bool stop (GLib.Cancellable cancellable, GLib.Error error);
- public virtual void stop_async (int io_priority, GLib.AsyncStopEnumeratingCallback @callback, pointer user_data, GLib.Cancellable cancellable);
+ public virtual void stop_async (int io_priority, GLib.AsyncStopEnumeratingCallback callback, pointer user_data, GLib.Cancellable cancellable);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class FileIcon : GLib.Object, GLib.Icon, GLib.LoadableIcon {
public weak GLib.File get_file ();
public static GLib.Type get_type ();
public FileIcon (GLib.File file);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class FileInfo : GLib.Object {
public weak GLib.FileInfo copy ();
public weak string get_attribute_as_string (string attribute);
public void set_display_name (string display_name);
public void set_edit_name (string edit_name);
public void set_file_type (GLib.FileType type);
- public void set_flags (GLib.FileFlags @flags);
+ public void set_flags (GLib.FileFlags flags);
public void set_icon (string icon);
public void set_modification_time (GLib.TimeVal mtime);
public void set_name (string name);
public void set_size (int64 size);
public void set_symlink_target (string symlink_target);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class FileInputStream : GLib.InputStream, GLib.Seekable {
public virtual weak GLib.FileInfo get_file_info (string attributes, GLib.Cancellable cancellable, GLib.Error error);
public static GLib.Type get_type ();
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class FileMonitor : GLib.Object {
public virtual bool cancel ();
public static weak GLib.DirectoryMonitor directory (GLib.File file);
public void set_rate_limit (int limit_msecs);
public signal void changed (GLib.File file, GLib.File other_file, GLib.FileMonitorEvent event_type);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class FileOutputStream : GLib.OutputStream {
public virtual weak GLib.FileInfo get_file_info (string attributes, GLib.Cancellable cancellable, GLib.Error error);
public void get_final_mtime (GLib.TimeVal mtime);
public void set_final_mtime (GLib.TimeVal final_mtime);
public void set_should_get_final_mtime (bool get_final_mtime);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class FilterInputStream : GLib.InputStream {
public weak GLib.InputStream get_base_stream ();
public static GLib.Type get_type ();
[NoAccessorMethod]
public weak GLib.InputStream base_stream { get; construct; }
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class FilterOutputStream : GLib.OutputStream {
public weak GLib.OutputStream get_base_stream ();
public static GLib.Type get_type ();
[NoAccessorMethod]
public weak GLib.OutputStream base_stream { get; construct; }
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class InputStream : GLib.Object {
public virtual bool close (GLib.Cancellable cancellable, GLib.Error error);
- public virtual void close_async (int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback @callback, pointer user_data);
+ public virtual void close_async (int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback callback, pointer user_data);
public virtual bool close_finish (GLib.AsyncResult result, GLib.Error error);
public static GLib.Type get_type ();
public bool has_pending ();
public bool is_closed ();
public virtual long read (pointer buffer, ulong count, GLib.Cancellable cancellable, GLib.Error error);
public bool read_all (pointer buffer, ulong count, ulong bytes_read, GLib.Cancellable cancellable, GLib.Error error);
- public virtual void read_async (pointer buffer, ulong count, int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback @callback, pointer user_data);
+ public virtual void read_async (pointer buffer, ulong count, int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback callback, pointer user_data);
public virtual long read_finish (GLib.AsyncResult result, GLib.Error error);
public void set_pending (bool pending);
public virtual long skip (ulong count, GLib.Cancellable cancellable, GLib.Error error);
- public virtual void skip_async (ulong count, int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback @callback, pointer user_data);
+ public virtual void skip_async (ulong count, int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback callback, pointer user_data);
public virtual long skip_finish (GLib.AsyncResult result, GLib.Error error);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class LocalDirectoryMonitor : GLib.DirectoryMonitor {
public static GLib.Type get_type ();
public static weak GLib.DirectoryMonitor start (string dirname);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class LocalFile : GLib.Object, GLib.File {
public static GLib.Type get_type ();
- public static weak GLib.FileInfo info_get (string basename, string path, GLib.FileAttributeMatcher attribute_matcher, GLib.FileGetInfoFlags @flags, GLib.LocalParentFileInfo parent_info, GLib.Error error);
+ public static weak GLib.FileInfo info_get (string basename, string path, GLib.FileAttributeMatcher attribute_matcher, GLib.FileGetInfoFlags flags, GLib.LocalParentFileInfo parent_info, GLib.Error error);
public static weak GLib.FileInfo info_get_from_fd (int fd, string attributes, GLib.Error error);
public static void info_get_parent_info (string dir, GLib.FileAttributeMatcher attribute_matcher, GLib.LocalParentFileInfo parent_info);
public LocalFile (string filename);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class LocalFileEnumerator : GLib.FileEnumerator {
public static GLib.Type get_type ();
- public LocalFileEnumerator (string filename, string attributes, GLib.FileGetInfoFlags @flags, GLib.Cancellable cancellable, GLib.Error error);
+ public LocalFileEnumerator (string filename, string attributes, GLib.FileGetInfoFlags flags, GLib.Cancellable cancellable, GLib.Error error);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class LocalFileInputStream : GLib.FileInputStream {
public static GLib.Type get_type ();
public LocalFileInputStream (int fd);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class LocalFileMonitor : GLib.FileMonitor {
public static GLib.Type get_type ();
public static weak GLib.FileMonitor start (string dirname);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class LocalFileOutputStream : GLib.FileOutputStream {
public static weak GLib.FileOutputStream append (string filename, GLib.Cancellable cancellable, GLib.Error error);
public static weak GLib.FileOutputStream create (string filename, GLib.Cancellable cancellable, GLib.Error error);
public static GLib.Type get_type ();
public static weak GLib.FileOutputStream replace (string filename, ulong mtime, bool make_backup, GLib.Cancellable cancellable, GLib.Error error);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class LocalVfs : GLib.Object, GLib.Vfs {
public static GLib.Type get_type ();
public LocalVfs ();
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class MemoryInputStream : GLib.InputStream, GLib.Seekable {
public static weak GLib.InputStream from_data (pointer data, ulong len);
public static GLib.Type get_type ();
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class MemoryOutputStream : GLib.OutputStream, GLib.Seekable {
public static GLib.Type get_type ();
public MemoryOutputStream (GLib.ByteArray data);
[NoAccessorMethod]
public weak uint size_limit { get; set; }
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class MountOperation : GLib.Object {
public bool get_anonymous ();
public int get_choice ();
public void set_password (string password);
public void set_password_save (GLib.PasswordSave save);
public void set_username (string username);
- public signal bool ask_password (string message, string default_user, string default_domain, GLib.PasswordFlags @flags);
+ public signal bool ask_password (string message, string default_user, string default_domain, GLib.PasswordFlags flags);
public signal bool ask_question (string message, string[] choices);
[HasEmitter]
public signal void reply (bool abort);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class OutputStream : GLib.Object {
public virtual bool close (GLib.Cancellable cancellable, GLib.Error error);
- public virtual void close_async (int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback @callback, pointer user_data);
+ public virtual void close_async (int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback callback, pointer user_data);
public virtual bool close_finish (GLib.AsyncResult result, GLib.Error error);
public virtual bool flush (GLib.Cancellable cancellable, GLib.Error error);
- public virtual void flush_async (int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback @callback, pointer user_data);
+ public virtual void flush_async (int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback callback, pointer user_data);
public virtual bool flush_finish (GLib.AsyncResult result, GLib.Error error);
public static GLib.Type get_type ();
public bool has_pending ();
public void set_pending (bool pending);
public virtual long write (pointer buffer, ulong count, GLib.Cancellable cancellable, GLib.Error error);
public bool write_all (pointer buffer, ulong count, ulong bytes_written, GLib.Cancellable cancellable, GLib.Error error);
- public virtual void write_async (pointer buffer, ulong count, int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback @callback, pointer user_data);
+ public virtual void write_async (pointer buffer, ulong count, int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback callback, pointer user_data);
public virtual long write_finish (GLib.AsyncResult result, GLib.Error error);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class SimpleAsyncResult : GLib.Object, GLib.AsyncResult {
public void complete ();
public void complete_in_idle ();
public long get_op_res_gssize ();
public pointer get_source_tag ();
public static GLib.Type get_type ();
- public SimpleAsyncResult (GLib.Object source_object, GLib.AsyncReadyCallback @callback, pointer user_data, pointer source_tag);
- public SimpleAsyncResult.error (GLib.Object source_object, GLib.AsyncReadyCallback @callback, pointer user_data, GLib.Quark domain, int code, string format);
- public SimpleAsyncResult.from_error (GLib.Object source_object, GLib.AsyncReadyCallback @callback, pointer user_data, GLib.Error error);
+ public SimpleAsyncResult (GLib.Object source_object, GLib.AsyncReadyCallback callback, pointer user_data, pointer source_tag);
+ public SimpleAsyncResult.error (GLib.Object source_object, GLib.AsyncReadyCallback callback, pointer user_data, GLib.Quark domain, int code, string format);
+ public SimpleAsyncResult.from_error (GLib.Object source_object, GLib.AsyncReadyCallback callback, pointer user_data, GLib.Error error);
public bool propagate_error (GLib.Error dest);
public void run_in_thread (GLib.SimpleAsyncThreadFunc func, int io_priority, GLib.Cancellable cancellable);
public void set_error (GLib.Quark domain, int code, string format);
public void set_op_res_gpointer (pointer op_res, GLib.DestroyNotify destroy_op_res);
public void set_op_res_gssize (long op_res);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class SocketInputStream : GLib.InputStream {
public static GLib.Type get_type ();
public SocketInputStream (int fd, bool close_fd_at_close);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class SocketOutputStream : GLib.OutputStream {
public static GLib.Type get_type ();
public SocketOutputStream (int fd, bool close_fd_at_close);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class ThemedIcon : GLib.Object, GLib.Icon {
public weak string get_names ();
public static GLib.Type get_type ();
public ThemedIcon (string iconname);
public ThemedIcon.from_names (string iconnames);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class UnionDrive : GLib.Object, GLib.Drive {
public bool child_is_for_monitor (GLib.VolumeMonitor child_monitor);
public static GLib.Type get_type ();
public bool is_for_child_drive (GLib.Drive child_drive);
public UnionDrive (GLib.VolumeMonitor union_monitor, GLib.Drive child_drive, GLib.VolumeMonitor child_monitor);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class UnionVolume : GLib.Object, GLib.Volume {
public void add_volume (GLib.Volume volume, GLib.VolumeMonitor monitor);
public weak GLib.Volume get_child_for_monitor (GLib.VolumeMonitor child_monitor);
public UnionVolume (GLib.VolumeMonitor union_monitor, GLib.Volume volume, GLib.VolumeMonitor monitor);
public void remove_volume (GLib.Volume volume);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class UnionVolumeMonitor : GLib.VolumeMonitor {
public weak GLib.Drive convert_drive (GLib.Drive child_drive);
public weak GLib.List convert_volumes (GLib.List child_volumes);
public static GLib.Type get_type ();
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class UnixDrive : GLib.Object, GLib.Drive {
public void disconnected ();
public static GLib.Type get_type ();
public void set_volume (GLib.UnixVolume volume);
public void unset_volume (GLib.UnixVolume volume);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class UnixVolume : GLib.Object, GLib.Volume {
public static GLib.Type get_type ();
public bool has_mountpoint (string mountpoint);
public void unmounted ();
public void unset_drive (GLib.UnixDrive drive);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class UnixVolumeMonitor : GLib.VolumeMonitor {
public static GLib.Type get_type ();
public weak GLib.UnixDrive lookup_drive_for_mountpoint (string mountpoint);
public UnixVolumeMonitor ();
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class VolumeMonitor : GLib.Object {
public virtual weak GLib.List get_connected_drives ();
public virtual weak GLib.List get_mounted_volumes ();
public signal void drive_connected (GLib.Drive drive);
public signal void drive_disconnected (GLib.Drive drive);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public class Win32AppInfo : GLib.Object, GLib.AppInfo {
public static GLib.Type get_type ();
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public interface AppInfo {
public static weak GLib.AppInfo create_from_commandline (string commandline, string application_name, GLib.Error error);
public virtual weak GLib.AppInfo dup ();
public virtual bool supports_uris ();
public virtual bool supports_xdg_startup_notify ();
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public interface AsyncResult {
public virtual weak GLib.Object get_source_object ();
public static GLib.Type get_type ();
public virtual pointer get_user_data ();
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public interface Drive {
public virtual bool can_eject ();
public virtual bool can_mount ();
- public virtual void eject (GLib.AsyncReadyCallback @callback, pointer user_data);
+ public virtual void eject (GLib.AsyncReadyCallback callback, pointer user_data);
public virtual bool eject_finish (GLib.AsyncResult result, GLib.Error error);
public virtual weak string get_icon ();
public virtual weak string get_name ();
public static GLib.Type get_type ();
public virtual weak GLib.List get_volumes ();
public virtual bool is_automounted ();
- public virtual void mount (GLib.MountOperation mount_operation, GLib.AsyncReadyCallback @callback, pointer user_data);
+ public virtual void mount (GLib.MountOperation mount_operation, GLib.AsyncReadyCallback callback, pointer user_data);
public virtual bool mount_finish (GLib.AsyncResult result, GLib.Error error);
public signal void changed ();
}
[CCode (cheader_filename = "gio/gfile.h")]
public interface File {
public virtual weak GLib.FileOutputStream append_to (GLib.Cancellable cancellable, GLib.Error error);
- public virtual bool copy (GLib.File destination, GLib.FileCopyFlags @flags, GLib.Cancellable cancellable, GLib.FileProgressCallback progress_callback, pointer progress_callback_data, GLib.Error error);
+ public virtual bool copy (GLib.File destination, GLib.FileCopyFlags flags, GLib.Cancellable cancellable, GLib.FileProgressCallback progress_callback, pointer progress_callback_data, GLib.Error error);
public virtual weak GLib.FileOutputStream create (GLib.Cancellable cancellable, GLib.Error error);
public bool delete (GLib.Cancellable cancellable, GLib.Error error);
public virtual weak GLib.File dup ();
- public virtual void eject_mountable (GLib.Cancellable cancellable, GLib.AsyncReadyCallback @callback, pointer user_data);
+ public virtual void eject_mountable (GLib.Cancellable cancellable, GLib.AsyncReadyCallback callback, pointer user_data);
public virtual bool eject_mountable_finish (GLib.AsyncResult result, GLib.Error error);
- public virtual weak GLib.FileEnumerator enumerate_children (string attributes, GLib.FileGetInfoFlags @flags, GLib.Cancellable cancellable, GLib.Error error);
+ public virtual weak GLib.FileEnumerator enumerate_children (string attributes, GLib.FileGetInfoFlags flags, GLib.Cancellable cancellable, GLib.Error error);
public virtual bool equal (GLib.File file2);
public virtual weak string get_basename ();
public weak GLib.File get_child (string name);
public virtual weak GLib.File get_child_for_display_name (string display_name, GLib.Error error);
- public void get_contents_async (GLib.Cancellable cancellable, GLib.AsyncReadyCallback @callback, pointer user_data);
+ public void get_contents_async (GLib.Cancellable cancellable, GLib.AsyncReadyCallback callback, pointer user_data);
public bool get_contents_finish (GLib.AsyncResult res, string contents, ulong length, GLib.Error error);
public virtual weak GLib.FileInfo get_filesystem_info (string attributes, GLib.Cancellable cancellable, GLib.Error error);
public static weak GLib.File get_for_commandline_arg (string arg);
public static weak GLib.File get_for_path (string path);
public static weak GLib.File get_for_uri (string uri);
- public virtual weak GLib.FileInfo get_info (string attributes, GLib.FileGetInfoFlags @flags, GLib.Cancellable cancellable, GLib.Error error);
+ public virtual weak GLib.FileInfo get_info (string attributes, GLib.FileGetInfoFlags flags, GLib.Cancellable cancellable, GLib.Error error);
public virtual weak GLib.File get_parent ();
public virtual weak string get_parse_name ();
public virtual weak string get_path ();
public virtual bool is_native ();
public virtual bool make_directory (GLib.Cancellable cancellable, GLib.Error error);
public virtual bool make_symbolic_link (string symlink_value, GLib.Cancellable cancellable, GLib.Error error);
- public virtual void mount_mountable (GLib.MountOperation mount_operation, GLib.Cancellable cancellable, GLib.AsyncReadyCallback @callback, pointer user_data);
+ public virtual void mount_mountable (GLib.MountOperation mount_operation, GLib.Cancellable cancellable, GLib.AsyncReadyCallback callback, pointer user_data);
public virtual weak GLib.File mount_mountable_finish (GLib.AsyncResult result, GLib.Error error);
- public virtual bool move (GLib.File destination, GLib.FileCopyFlags @flags, GLib.Cancellable cancellable, GLib.FileProgressCallback progress_callback, pointer progress_callback_data, GLib.Error error);
+ public virtual bool move (GLib.File destination, GLib.FileCopyFlags flags, GLib.Cancellable cancellable, GLib.FileProgressCallback progress_callback, pointer progress_callback_data, GLib.Error error);
public static weak GLib.File parse_name (string parse_name);
public virtual weak GLib.FileInputStream read (GLib.Cancellable cancellable, GLib.Error error);
- public virtual void read_async (int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback @callback, pointer user_data);
+ public virtual void read_async (int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback callback, pointer user_data);
public virtual weak GLib.FileInputStream read_finish (GLib.AsyncResult res, GLib.Error error);
public virtual weak GLib.FileOutputStream replace (ulong mtime, bool make_backup, GLib.Cancellable cancellable, GLib.Error error);
public virtual weak GLib.File resolve_relative (string relative_path);
- public virtual bool set_attribute (string attribute, GLib.FileAttributeType type, pointer value, GLib.FileGetInfoFlags @flags, GLib.Cancellable cancellable, GLib.Error error);
- public bool set_attribute_byte_string (string attribute, string value, GLib.FileGetInfoFlags @flags, GLib.Cancellable cancellable, GLib.Error error);
- public bool set_attribute_int32 (string attribute, string value, GLib.FileGetInfoFlags @flags, GLib.Cancellable cancellable, GLib.Error error);
- public bool set_attribute_int64 (string attribute, int64 value, GLib.FileGetInfoFlags @flags, GLib.Cancellable cancellable, GLib.Error error);
- public bool set_attribute_string (string attribute, string value, GLib.FileGetInfoFlags @flags, GLib.Cancellable cancellable, GLib.Error error);
- public bool set_attribute_uint32 (string attribute, uint value, GLib.FileGetInfoFlags @flags, GLib.Cancellable cancellable, GLib.Error error);
- public bool set_attribute_uint64 (string attribute, uint64 value, GLib.FileGetInfoFlags @flags, GLib.Cancellable cancellable, GLib.Error error);
+ public virtual bool set_attribute (string attribute, GLib.FileAttributeType type, pointer value, GLib.FileGetInfoFlags flags, GLib.Cancellable cancellable, GLib.Error error);
+ public bool set_attribute_byte_string (string attribute, string value, GLib.FileGetInfoFlags flags, GLib.Cancellable cancellable, GLib.Error error);
+ public bool set_attribute_int32 (string attribute, string value, GLib.FileGetInfoFlags flags, GLib.Cancellable cancellable, GLib.Error error);
+ public bool set_attribute_int64 (string attribute, int64 value, GLib.FileGetInfoFlags flags, GLib.Cancellable cancellable, GLib.Error error);
+ public bool set_attribute_string (string attribute, string value, GLib.FileGetInfoFlags flags, GLib.Cancellable cancellable, GLib.Error error);
+ public bool set_attribute_uint32 (string attribute, uint value, GLib.FileGetInfoFlags flags, GLib.Cancellable cancellable, GLib.Error error);
+ public bool set_attribute_uint64 (string attribute, uint64 value, GLib.FileGetInfoFlags flags, GLib.Cancellable cancellable, GLib.Error error);
public virtual weak GLib.File set_display_name (string display_name, GLib.Cancellable cancellable, GLib.Error error);
public virtual bool trash (GLib.Cancellable cancellable, GLib.Error error);
- public virtual void unmount_mountable (GLib.Cancellable cancellable, GLib.AsyncReadyCallback @callback, pointer user_data);
+ public virtual void unmount_mountable (GLib.Cancellable cancellable, GLib.AsyncReadyCallback callback, pointer user_data);
public virtual bool unmount_mountable_finish (GLib.AsyncResult result, GLib.Error error);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public interface Icon {
public virtual bool equal (GLib.Icon icon2);
public static GLib.Type get_type ();
public static uint hash (pointer icon);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public interface LoadableIcon {
public static GLib.Type get_type ();
public virtual weak GLib.InputStream load (int size, string type, GLib.Cancellable cancellable, GLib.Error error);
- public virtual void load_async (int size, GLib.Cancellable cancellable, GLib.AsyncReadyCallback @callback, pointer user_data);
+ public virtual void load_async (int size, GLib.Cancellable cancellable, GLib.AsyncReadyCallback callback, pointer user_data);
public virtual weak GLib.InputStream load_finish (GLib.AsyncResult res, string type, GLib.Error error);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public interface Seekable {
public virtual bool can_seek ();
public virtual bool can_truncate ();
public virtual int64 tell ();
public virtual bool truncate (int64 offset, GLib.Cancellable cancellable, GLib.Error err);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public interface Vfs {
public static weak GLib.Vfs get ();
public virtual weak GLib.File get_file_for_path (string path);
public static GLib.Type get_type ();
public virtual weak GLib.File parse_name (string parse_name);
}
- [CCode (cheader_filename = "gio/gvfs.h")]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public interface Volume {
public virtual bool can_eject ();
public virtual bool can_unmount ();
- public virtual void eject (GLib.AsyncReadyCallback @callback, pointer user_data);
+ public virtual void eject (GLib.AsyncReadyCallback callback, pointer user_data);
public virtual bool eject_finish (GLib.AsyncResult result, GLib.Error error);
public virtual weak GLib.Drive get_drive ();
public virtual weak string get_icon ();
public virtual weak string get_platform_id ();
public virtual weak GLib.File get_root ();
public static GLib.Type get_type ();
- public virtual void unmount (GLib.AsyncReadyCallback @callback, pointer user_data);
+ public virtual void unmount (GLib.AsyncReadyCallback callback, pointer user_data);
public virtual bool unmount_finish (GLib.AsyncResult result, GLib.Error error);
public signal void changed ();
}
[ReferenceType]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public struct AsyncResultData {
public pointer async_object;
public weak GLib.Error error;
public pointer user_data;
}
[ReferenceType]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public struct FileAttributeMatcher {
public bool enumerate_namespace (string @namespace);
public weak string enumerate_next ();
public FileAttributeMatcher (string attributes);
}
[ReferenceType]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public struct IOJob {
public void send_to_mainloop (GLib.IODataFunc func, pointer user_data, GLib.DestroyNotify notify, bool block);
}
[ReferenceType]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public struct LocalParentFileInfo {
public bool writable;
public bool is_sticky;
public int owner;
}
[ReferenceType]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public struct UnixMount {
public weak string mount_path;
public weak string device_path;
public bool is_read_only;
}
[ReferenceType]
+ [CCode (cheader_filename = "gio/gvfs.h, glib.h")]
public struct UnixMountPoint {
public weak string mount_path;
public weak string device_path;
FILENAME_ARRAY
}
- public flags OptionFlags {
+ [Flags]
+ public enum OptionFlags {
HIDDEN,
IN_MAIN,
REVERSE,
public void replace (K# key, V# value);
public weak V lookup (K key);
public bool remove (K key);
- public ref List<weak K> get_keys ();
- public ref List<weak V> get_values ();
+ public List<weak K> get_keys ();
+ public List<weak V> get_values ();
[CCode (cname = "g_hash_table_foreach")]
public void for_each (HFunc func, pointer user_data);
}
-[CCode (cprefix = "Gst", lower_case_cprefix = "gst_", cheader_filename = "gst/gst.h")]
+[CCode (cprefix = "Gst", lower_case_cprefix = "gst_")]
namespace Gst {
- [CCode (cprefix = "GST_ACTIVATE_")]
+ [CCode (cprefix = "GST_ACTIVATE_", cheader_filename = "gst/gst.h")]
public enum ActivateMode {
NONE,
PUSH,
PULL,
}
- [CCode (cprefix = "GST_ALLOC_TRACE_")]
+ [CCode (cprefix = "GST_ALLOC_TRACE_", cheader_filename = "gst/gst.h")]
public enum AllocTraceFlags {
LIVE,
MEM_LIVE,
}
- [CCode (cprefix = "GST_ASSOCIATION_FLAG_")]
+ [CCode (cprefix = "GST_ASSOCIATION_FLAG_", cheader_filename = "gst/gst.h")]
public enum AssocFlags {
NONE,
KEY_UNIT,
DELTA_UNIT,
LAST,
}
- [CCode (cprefix = "GST_BIN_FLAG_")]
+ [CCode (cprefix = "GST_BIN_FLAG_", cheader_filename = "gst/gst.h")]
public enum BinFlags {
LAST,
}
- [CCode (cprefix = "GST_BUFFER_COPY_")]
+ [CCode (cprefix = "GST_BUFFER_COPY_", cheader_filename = "gst/gst.h")]
public enum BufferCopyFlags {
FLAGS,
TIMESTAMPS,
CAPS,
}
- [CCode (cprefix = "GST_BUFFER_FLAG_")]
+ [CCode (cprefix = "GST_BUFFER_FLAG_", cheader_filename = "gst/gst.h")]
public enum BufferFlag {
READONLY,
PREROLL,
DELTA_UNIT,
LAST,
}
- [CCode (cprefix = "GST_BUS_")]
+ [CCode (cprefix = "GST_BUS_", cheader_filename = "gst/gst.h")]
public enum BusFlags {
FLUSHING,
FLAG_LAST,
}
- [CCode (cprefix = "GST_BUS_")]
+ [CCode (cprefix = "GST_BUS_", cheader_filename = "gst/gst.h")]
public enum BusSyncReply {
DROP,
PASS,
ASYNC,
}
- [CCode (cprefix = "GST_CAPS_FLAGS_")]
+ [CCode (cprefix = "GST_CAPS_FLAGS_", cheader_filename = "gst/gst.h")]
public enum CapsFlags {
ANY,
}
- [CCode (cprefix = "GST_CLOCK_ENTRY_")]
+ [CCode (cprefix = "GST_CLOCK_ENTRY_", cheader_filename = "gst/gst.h")]
public enum ClockEntryType {
SINGLE,
PERIODIC,
}
- [CCode (cprefix = "GST_CLOCK_FLAG_")]
+ [CCode (cprefix = "GST_CLOCK_FLAG_", cheader_filename = "gst/gst.h")]
public enum ClockFlags {
CAN_DO_SINGLE_SYNC,
CAN_DO_SINGLE_ASYNC,
CAN_SET_MASTER,
LAST,
}
- [CCode (cprefix = "GST_CLOCK_")]
+ [CCode (cprefix = "GST_CLOCK_", cheader_filename = "gst/gst.h")]
public enum ClockReturn {
OK,
EARLY,
ERROR,
UNSUPPORTED,
}
- [CCode (cprefix = "GST_CORE_ERROR_")]
+ [CCode (cprefix = "GST_CORE_ERROR_", cheader_filename = "gst/gst.h")]
public enum CoreError {
FAILED,
TOO_LAZY,
DISABLED,
NUM_ERRORS,
}
- [CCode (cprefix = "GST_DEBUG_")]
+ [CCode (cprefix = "GST_DEBUG_", cheader_filename = "gst/gst.h")]
public enum DebugColorFlags {
FG_BLACK,
FG_RED,
BOLD,
UNDERLINE,
}
- [CCode (cprefix = "GST_LEVEL_")]
+ [CCode (cprefix = "GST_LEVEL_", cheader_filename = "gst/gst.h")]
public enum DebugLevel {
NONE,
ERROR,
LOG,
COUNT,
}
- [CCode (cprefix = "GST_ELEMENT_")]
+ [CCode (cprefix = "GST_ELEMENT_", cheader_filename = "gst/gst.h")]
public enum ElementFlags {
LOCKED_STATE,
IS_SINK,
UNPARENTING,
FLAG_LAST,
}
- [CCode (cprefix = "GST_EVENT_")]
+ [CCode (cprefix = "GST_EVENT_", cheader_filename = "gst/gst.h")]
public enum EventType {
UNKNOWN,
FLUSH_START,
CUSTOM_BOTH,
CUSTOM_BOTH_OOB,
}
- [CCode (cprefix = "GST_EVENT_TYPE_")]
+ [CCode (cprefix = "GST_EVENT_TYPE_", cheader_filename = "gst/gst.h")]
public enum EventTypeFlags {
UPSTREAM,
DOWNSTREAM,
SERIALIZED,
}
- [CCode (cprefix = "GST_FLOW_")]
+ [CCode (cprefix = "GST_FLOW_", cheader_filename = "gst/gst.h")]
public enum FlowReturn {
CUSTOM_SUCCESS,
RESEND,
NOT_SUPPORTED,
CUSTOM_ERROR,
}
- [CCode (cprefix = "GST_FORMAT_")]
+ [CCode (cprefix = "GST_FORMAT_", cheader_filename = "gst/gst.h")]
public enum Format {
UNDEFINED,
DEFAULT,
BUFFERS,
PERCENT,
}
- [CCode (cprefix = "GST_INDEX_")]
+ [CCode (cprefix = "GST_INDEX_", cheader_filename = "gst/gst.h")]
public enum IndexCertainty {
UNKNOWN,
CERTAIN,
FUZZY,
}
- [CCode (cprefix = "GST_INDEX_ENTRY_")]
+ [CCode (cprefix = "GST_INDEX_ENTRY_", cheader_filename = "gst/gst.h")]
public enum IndexEntryType {
ID,
ASSOCIATION,
OBJECT,
FORMAT,
}
- [CCode (cprefix = "GST_INDEX_")]
+ [CCode (cprefix = "GST_INDEX_", cheader_filename = "gst/gst.h")]
public enum IndexFlags {
WRITABLE,
READABLE,
FLAG_LAST,
}
- [CCode (cprefix = "GST_INDEX_LOOKUP_")]
+ [CCode (cprefix = "GST_INDEX_LOOKUP_", cheader_filename = "gst/gst.h")]
public enum IndexLookupMethod {
EXACT,
BEFORE,
AFTER,
}
- [CCode (cprefix = "GST_INDEX_RESOLVER_")]
+ [CCode (cprefix = "GST_INDEX_RESOLVER_", cheader_filename = "gst/gst.h")]
public enum IndexResolverMethod {
CUSTOM,
GTYPE,
PATH,
}
- [CCode (cprefix = "GST_ITERATOR_ITEM_")]
+ [CCode (cprefix = "GST_ITERATOR_ITEM_", cheader_filename = "gst/gst.h")]
public enum IteratorItem {
SKIP,
PASS,
END,
}
- [CCode (cprefix = "GST_ITERATOR_")]
+ [CCode (cprefix = "GST_ITERATOR_", cheader_filename = "gst/gst.h")]
public enum IteratorResult {
DONE,
OK,
RESYNC,
ERROR,
}
- [CCode (cprefix = "GST_LIBRARY_ERROR_")]
+ [CCode (cprefix = "GST_LIBRARY_ERROR_", cheader_filename = "gst/gst.h")]
public enum LibraryError {
FAILED,
TOO_LAZY,
ENCODE,
NUM_ERRORS,
}
- [CCode (cprefix = "GST_MESSAGE_")]
+ [CCode (cprefix = "GST_MESSAGE_", cheader_filename = "gst/gst.h")]
public enum MessageType {
UNKNOWN,
EOS,
ASYNC_DONE,
ANY,
}
- [CCode (cprefix = "GST_MINI_OBJECT_FLAG_")]
+ [CCode (cprefix = "GST_MINI_OBJECT_FLAG_", cheader_filename = "gst/gst.h")]
public enum MiniObjectFlags {
READONLY,
LAST,
}
- [CCode (cprefix = "GST_OBJECT_")]
+ [CCode (cprefix = "GST_OBJECT_", cheader_filename = "gst/gst.h")]
public enum ObjectFlags {
DISPOSING,
FLOATING,
FLAG_LAST,
}
- [CCode (cprefix = "GST_PAD_")]
+ [CCode (cprefix = "GST_PAD_", cheader_filename = "gst/gst.h")]
public enum PadDirection {
UNKNOWN,
SRC,
SINK,
}
- [CCode (cprefix = "GST_PAD_")]
+ [CCode (cprefix = "GST_PAD_", cheader_filename = "gst/gst.h")]
public enum PadFlags {
BLOCKED,
FLUSHING,
BLOCKING,
FLAG_LAST,
}
- [CCode (cprefix = "GST_PAD_LINK_")]
+ [CCode (cprefix = "GST_PAD_LINK_", cheader_filename = "gst/gst.h")]
public enum PadLinkReturn {
OK,
WRONG_HIERARCHY,
NOSCHED,
REFUSED,
}
- [CCode (cprefix = "GST_PAD_")]
+ [CCode (cprefix = "GST_PAD_", cheader_filename = "gst/gst.h")]
public enum PadPresence {
ALWAYS,
SOMETIMES,
REQUEST,
}
- [CCode (cprefix = "GST_PAD_TEMPLATE_")]
+ [CCode (cprefix = "GST_PAD_TEMPLATE_", cheader_filename = "gst/gst.h")]
public enum PadTemplateFlags {
FIXED,
FLAG_LAST,
}
- [CCode (cprefix = "GST_PARSE_ERROR_")]
+ [CCode (cprefix = "GST_PARSE_ERROR_", cheader_filename = "gst/gst.h")]
public enum ParseError {
SYNTAX,
NO_SUCH_ELEMENT,
EMPTY_BIN,
EMPTY,
}
- [CCode (cprefix = "GST_PIPELINE_FLAG_")]
+ [CCode (cprefix = "GST_PIPELINE_FLAG_", cheader_filename = "gst/gst.h")]
public enum PipelineFlags {
FIXED_CLOCK,
LAST,
}
- [CCode (cprefix = "GST_PLUGIN_ERROR_")]
+ [CCode (cprefix = "GST_PLUGIN_ERROR_", cheader_filename = "gst/gst.h")]
public enum PluginError {
MODULE,
DEPENDENCIES,
NAME_MISMATCH,
}
- [CCode (cprefix = "GST_PLUGIN_FLAG_")]
+ [CCode (cprefix = "GST_PLUGIN_FLAG_", cheader_filename = "gst/gst.h")]
public enum PluginFlags {
CACHED,
}
- [CCode (cprefix = "GST_QUARK_")]
+ [CCode (cprefix = "GST_QUARK_", cheader_filename = "gst/gst.h")]
public enum QuarkId {
FORMAT,
CURRENT,
STOP_VALUE,
MAX,
}
- [CCode (cprefix = "GST_QUERY_")]
+ [CCode (cprefix = "GST_QUERY_", cheader_filename = "gst/gst.h")]
public enum QueryType {
NONE,
POSITION,
CONVERT,
FORMATS,
}
- [CCode (cprefix = "GST_RANK_")]
+ [CCode (cprefix = "GST_RANK_", cheader_filename = "gst/gst.h")]
public enum Rank {
NONE,
MARGINAL,
SECONDARY,
PRIMARY,
}
- [CCode (cprefix = "GST_RESOURCE_ERROR_")]
+ [CCode (cprefix = "GST_RESOURCE_ERROR_", cheader_filename = "gst/gst.h")]
public enum ResourceError {
FAILED,
TOO_LAZY,
NO_SPACE_LEFT,
NUM_ERRORS,
}
- [CCode (cprefix = "GST_SEEK_FLAG_")]
+ [CCode (cprefix = "GST_SEEK_FLAG_", cheader_filename = "gst/gst.h")]
public enum SeekFlags {
NONE,
FLUSH,
KEY_UNIT,
SEGMENT,
}
- [CCode (cprefix = "GST_SEEK_TYPE_")]
+ [CCode (cprefix = "GST_SEEK_TYPE_", cheader_filename = "gst/gst.h")]
public enum SeekType {
NONE,
CUR,
SET,
END,
}
- [CCode (cprefix = "GST_STATE_")]
+ [CCode (cprefix = "GST_STATE_", cheader_filename = "gst/gst.h")]
public enum State {
VOID_PENDING,
NULL,
PAUSED,
PLAYING,
}
- [CCode (cprefix = "GST_STATE_CHANGE_")]
+ [CCode (cprefix = "GST_STATE_CHANGE_", cheader_filename = "gst/gst.h")]
public enum StateChange {
NULL_TO_READY,
READY_TO_PAUSED,
PAUSED_TO_READY,
READY_TO_NULL,
}
- [CCode (cprefix = "GST_STATE_CHANGE_")]
+ [CCode (cprefix = "GST_STATE_CHANGE_", cheader_filename = "gst/gst.h")]
public enum StateChangeReturn {
FAILURE,
SUCCESS,
ASYNC,
NO_PREROLL,
}
- [CCode (cprefix = "GST_STREAM_ERROR_")]
+ [CCode (cprefix = "GST_STREAM_ERROR_", cheader_filename = "gst/gst.h")]
public enum StreamError {
FAILED,
TOO_LAZY,
FORMAT,
NUM_ERRORS,
}
- [CCode (cprefix = "GST_TAG_FLAG_")]
+ [CCode (cprefix = "GST_TAG_FLAG_", cheader_filename = "gst/gst.h")]
public enum TagFlag {
UNDEFINED,
META,
DECODED,
COUNT,
}
- [CCode (cprefix = "GST_TAG_MERGE_")]
+ [CCode (cprefix = "GST_TAG_MERGE_", cheader_filename = "gst/gst.h")]
public enum TagMergeMode {
UNDEFINED,
REPLACE_ALL,
KEEP_ALL,
COUNT,
}
- [CCode (cprefix = "GST_TASK_")]
+ [CCode (cprefix = "GST_TASK_", cheader_filename = "gst/gst.h")]
public enum TaskState {
STARTED,
STOPPED,
PAUSED,
}
- [CCode (cprefix = "GST_TYPE_FIND_")]
+ [CCode (cprefix = "GST_TYPE_FIND_", cheader_filename = "gst/gst.h")]
public enum TypeFindProbability {
MINIMUM,
POSSIBLE,
NEARLY_CERTAIN,
MAXIMUM,
}
- [CCode (cprefix = "GST_URI_")]
+ [CCode (cprefix = "GST_URI_", cheader_filename = "gst/gst.h")]
public enum URIType {
UNKNOWN,
SINK,
public uint64 offset;
public uint64 offset_end;
public uchar malloc_data;
- public void copy_metadata (Gst.Buffer src, Gst.BufferCopyFlags @flags);
+ public void copy_metadata (Gst.Buffer src, Gst.BufferCopyFlags flags);
public weak Gst.Buffer create_sub (uint offset, uint size);
public weak Gst.Caps get_caps ();
public static GLib.Type get_type ();
public void release_request_pad (Gst.Pad pad);
public bool remove_pad (Gst.Pad pad);
public bool requires_clock ();
- public bool seek (double rate, Gst.Format format, Gst.SeekFlags @flags, Gst.SeekType cur_type, int64 cur, Gst.SeekType stop_type, int64 stop);
+ public bool seek (double rate, Gst.Format format, Gst.SeekFlags flags, Gst.SeekType cur_type, int64 cur, Gst.SeekType stop_type, int64 stop);
public bool seek_simple (Gst.Format format, Gst.SeekFlags seek_flags, int64 seek_pos);
public virtual bool send_event (Gst.Event event);
public void set_base_time (uint64 time);
public Event.new_segment (bool update, double rate, Gst.Format format, int64 start, int64 stop, int64 position);
public Event.new_segment_full (bool update, double rate, double applied_rate, Gst.Format format, int64 start, int64 stop, int64 position);
public Event.qos (double proportion, int64 diff, uint64 timestamp);
- public Event.seek (double rate, Gst.Format format, Gst.SeekFlags @flags, Gst.SeekType start_type, int64 start, Gst.SeekType stop_type, int64 stop);
+ public Event.seek (double rate, Gst.Format format, Gst.SeekFlags flags, Gst.SeekType start_type, int64 start, Gst.SeekType stop_type, int64 stop);
public Event.tag (Gst.TagList taglist);
public void parse_buffer_size (Gst.Format format, int64 minsize, int64 maxsize, bool async);
public void parse_latency (uint64 latency);
public void parse_new_segment (bool update, double rate, Gst.Format format, int64 start, int64 stop, int64 position);
public void parse_new_segment_full (bool update, double rate, double applied_rate, Gst.Format format, int64 start, int64 stop, int64 position);
public void parse_qos (double proportion, int64 diff, uint64 timestamp);
- public void parse_seek (double rate, Gst.Format format, Gst.SeekFlags @flags, Gst.SeekType start_type, int64 start, Gst.SeekType stop_type, int64 stop);
+ public void parse_seek (double rate, Gst.Format format, Gst.SeekFlags flags, Gst.SeekType start_type, int64 start, Gst.SeekType stop_type, int64 stop);
public void parse_tag (Gst.TagList taglist);
public static Gst.EventTypeFlags type_get_flags (Gst.EventType type);
public static weak string type_get_name (Gst.EventType type);
}
[CCode (cheader_filename = "gst/gst.h")]
public class Index : Gst.Object {
- public weak Gst.IndexEntry add_association (int id, Gst.AssocFlags @flags, Gst.Format format, int64 value);
- public weak Gst.IndexEntry add_associationv (int id, Gst.AssocFlags @flags, int n, Gst.IndexAssociation list);
+ public weak Gst.IndexEntry add_association (int id, Gst.AssocFlags flags, Gst.Format format, int64 value);
+ public weak Gst.IndexEntry add_associationv (int id, Gst.AssocFlags flags, int n, Gst.IndexAssociation list);
public weak Gst.IndexEntry add_format (int id, Gst.Format format);
public weak Gst.IndexEntry add_id (int id, string description);
public weak Gst.IndexEntry add_object (int id, string key, GLib.Type type, pointer object);
public virtual void commit (int id);
- public virtual weak Gst.IndexEntry get_assoc_entry (int id, Gst.IndexLookupMethod method, Gst.AssocFlags @flags, Gst.Format format, int64 value);
- public weak Gst.IndexEntry get_assoc_entry_full (int id, Gst.IndexLookupMethod method, Gst.AssocFlags @flags, Gst.Format format, int64 value, GLib.CompareDataFunc func, pointer user_data);
+ public virtual weak Gst.IndexEntry get_assoc_entry (int id, Gst.IndexLookupMethod method, Gst.AssocFlags flags, Gst.Format format, int64 value);
+ public weak Gst.IndexEntry get_assoc_entry_full (int id, Gst.IndexLookupMethod method, Gst.AssocFlags flags, Gst.Format format, int64 value, GLib.CompareDataFunc func, pointer user_data);
public Gst.IndexCertainty get_certainty ();
public int get_group ();
public static GLib.Type get_type ();
[CCode (cheader_filename = "gst/gst.h")]
public class MiniObject : GLib.TypeInstance, GLib.Object {
public int refcount;
- public uint @flags;
+ public uint flags;
public weak Gst.MiniObject copy ();
public static GLib.Type get_type ();
public bool is_writable ();
public weak GLib.Mutex @lock;
public weak string name_prefix;
public weak Gst.Object parent;
- public uint @flags;
+ public uint flags;
public static bool check_uniqueness (GLib.List list, string name);
public static void default_deep_notify (GLib.Object object, Gst.Object orig, GLib.ParamSpec pspec, string excluded_props);
public void default_error (GLib.Error error, string debug);
public void set_activatepush_function (Gst.PadActivateModeFunction activatepush);
public bool set_active (bool active);
public bool set_blocked (bool blocked);
- public bool set_blocked_async (bool blocked, Gst.PadBlockCallback @callback, pointer user_data);
+ public bool set_blocked_async (bool blocked, Gst.PadBlockCallback callback, pointer user_data);
public void set_bufferalloc_function (Gst.PadBufferAllocFunction bufalloc);
public bool set_caps (Gst.Caps caps);
public void set_chain_function (Gst.PadChainFunction chain);
public virtual bool set_uri (string uri);
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct AllocTrace {
public weak string name;
- public int @flags;
+ public int flags;
public int live;
public weak GLib.SList mem_live;
public static bool available ();
public void print ();
public static void print_all ();
public static void print_live ();
- public void set_flags (Gst.AllocTraceFlags @flags);
- public static void set_flags_all (Gst.AllocTraceFlags @flags);
+ public void set_flags (Gst.AllocTraceFlags flags);
+ public static void set_flags_all (Gst.AllocTraceFlags flags);
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct BinaryChunk {
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct BinaryElementFactory {
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct BinaryPadTemplate {
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct BinaryPluginElement {
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct BinaryPluginFeature {
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct BinaryRegistryMagic {
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct BinaryTypeFindFactory {
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct Caps {
public GLib.Type type;
public int refcount;
- public Gst.CapsFlags @flags;
+ public Gst.CapsFlags flags;
public void append (Gst.Caps caps2);
public void append_structure (Gst.Structure structure);
public weak Gst.Caps copy ();
public void unref ();
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct ClockEntry {
public int refcount;
public weak Gst.Clock clock;
public pointer user_data;
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct DebugCategory {
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct DebugMessage {
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct ElementDetails {
public weak string longname;
public weak string klass;
public weak string author;
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct FormatDefinition {
public Gst.Format value;
public weak string nick;
public GLib.Quark quark;
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct IndexAssociation {
public Gst.Format format;
public int64 value;
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct IndexEntry {
public bool assoc_map (Gst.Format format, int64 value);
public weak Gst.IndexEntry copy ();
public static GLib.Type get_type ();
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct IndexGroup {
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct Iterator {
public Gst.IteratorNextFunction next;
public Gst.IteratorItemFunction item;
public void push (Gst.Iterator other);
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct PluginDesc {
public int major_version;
public int minor_version;
public pointer _gst_reserved;
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct QueryTypeDefinition {
public Gst.QueryType value;
public weak string nick;
public GLib.Quark quark;
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct Segment {
public double rate;
public double abs_rate;
public Gst.Format format;
- public Gst.SeekFlags @flags;
+ public Gst.SeekFlags flags;
public int64 start;
public int64 stop;
public int64 time;
public void set_last_stop (Gst.Format format, int64 position);
public void set_newsegment (bool update, double rate, Gst.Format format, int64 start, int64 stop, int64 time);
public void set_newsegment_full (bool update, double rate, double applied_rate, Gst.Format format, int64 start, int64 stop, int64 time);
- public void set_seek (double rate, Gst.Format format, Gst.SeekFlags @flags, Gst.SeekType start_type, int64 start, Gst.SeekType stop_type, int64 stop, bool update);
+ public void set_seek (double rate, Gst.Format format, Gst.SeekFlags flags, Gst.SeekType start_type, int64 start, Gst.SeekType stop_type, int64 stop, bool update);
public int64 to_running_time (Gst.Format format, int64 position);
public int64 to_stream_time (Gst.Format format, int64 position);
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct StaticCaps {
public weak Gst.Caps caps;
public weak string string;
public static GLib.Type get_type ();
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct StaticPadTemplate {
public weak string name_template;
public Gst.PadDirection direction;
public static GLib.Type get_type ();
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct Structure {
public GLib.Type type;
public weak Gst.Structure copy ();
public weak string to_string ();
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct TagList {
public GLib.Type type;
public void add (Gst.TagMergeMode mode, string tag);
public void remove_tag (string tag);
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct Trace {
public void destroy ();
public void flush ();
public void text_flush ();
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct TraceEntry {
public int64 timestamp;
public uint sequence;
public char message;
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct TypeFind {
public pointer data;
public pointer _gst_reserved;
public void suggest (uint probability, Gst.Caps caps);
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct TypeNameData {
public weak string name;
public GLib.Type type;
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct ValueTable {
public GLib.Type type;
public Gst.ValueCompareFunc compare;
public Gst.ValueDeserializeFunc deserialize;
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct Debug {
public static void print_stack_trace ();
public static uint remove_log_function (Gst.LogFunction func);
public static uint remove_log_function_by_data (pointer data);
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct Flow {
public static weak string get_name (Gst.FlowReturn ret);
public static GLib.Quark to_quark (Gst.FlowReturn ret);
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct Fraction {
public static GLib.Type get_type ();
public static GLib.Type range_get_type ();
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct Init {
public static bool check (int argc, string argv, GLib.Error err);
public static weak GLib.OptionGroup get_option_group ();
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct Print {
public static void element_args (GLib.String buf, int indent, Gst.Element element);
public static void pad_caps (GLib.String buf, int indent, Gst.Pad pad);
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct Segtrap {
public static bool is_enabled ();
public static void set_enabled (bool enabled);
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct Tag {
public static bool exists (string tag);
public static weak string get_description (string tag);
public static void register (string name, Gst.TagFlag flag, GLib.Type type, string nick, string blurb, Gst.TagMergeFunc func);
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct Uri {
public static weak string @construct (string protocol, string location);
public static weak string get_location (string uri);
public static bool protocol_is_valid (string protocol);
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct Util {
[NoArrayLength]
public static void dump_mem (uchar[] mem, uint size);
public static uint64 uint64_scale_int (uint64 val, int num, int denom);
}
[ReferenceType]
+ [CCode (cheader_filename = "gst/gst.h")]
public struct Value {
public static void array_append_value (GLib.Value value, GLib.Value append_value);
public static uint array_get_size (GLib.Value value);
public static delegate string ValueSerializeFunc (GLib.Value value1);
public static delegate bool ValueSubtractFunc (GLib.Value dest, GLib.Value minuend, GLib.Value subtrahend);
public static delegate bool ValueUnionFunc (GLib.Value dest, GLib.Value value1, GLib.Value value2);
+ public static void init (ref string[] args);
public static void atomic_int_set (int atomic_int, int value);
public static void class_signal_emit_by_name (Gst.Object object, string name, pointer self);
public static GLib.Quark core_error_quark ();
public static GLib.Type int_range_get_type ();
public static bool is_tag_list (pointer p);
public static GLib.Quark library_error_quark ();
- public static weak GLib.ParamSpec param_spec_mini_object (string name, string nick, string blurb, GLib.Type object_type, GLib.ParamFlags @flags);
+ public static weak GLib.ParamSpec param_spec_mini_object (string name, string nick, string blurb, GLib.Type object_type, GLib.ParamFlags flags);
public static weak Gst.Element parse_bin_from_description (string bin_description, bool ghost_unconnected_pads, GLib.Error err);
public static GLib.Quark parse_error_quark ();
public static weak Gst.Element parse_launch (string pipeline_description, GLib.Error error);
public static bool update_registry ();
public static weak string version_string ();
}
-[CCode (cprefix = "Gst", lower_case_cprefix = "gst_", cheader_filename = "gst/gst.h")]
-namespace Gst {
- public static void init (ref string[] args);
-}
-[CCode (cprefix = "Gtk", lower_case_cprefix = "gtk_", cheader_filename = "gtk/gtk.h")]
+[CCode (cprefix = "Gtk", lower_case_cprefix = "gtk_")]
namespace Gtk {
- [CCode (cprefix = "GTK_ACCEL_")]
+ [CCode (cprefix = "GTK_ACCEL_", cheader_filename = "gtk/gtk.h")]
public enum AccelFlags {
VISIBLE,
LOCKED,
MASK,
}
- [CCode (cprefix = "GTK_ANCHOR_")]
+ [CCode (cprefix = "GTK_ANCHOR_", cheader_filename = "gtk/gtk.h")]
public enum AnchorType {
CENTER,
NORTH,
W,
E,
}
- [CCode (cprefix = "GTK_ARG_")]
+ [CCode (cprefix = "GTK_ARG_", cheader_filename = "gtk/gtk.h")]
public enum ArgFlags {
READABLE,
WRITABLE,
CONSTRUCT_ONLY,
CHILD_ARG,
}
- [CCode (cprefix = "GTK_ARROW_")]
+ [CCode (cprefix = "GTK_ARROW_", cheader_filename = "gtk/gtk.h")]
public enum ArrowType {
UP,
DOWN,
RIGHT,
NONE,
}
- [CCode (cprefix = "GTK_ASSISTANT_PAGE_")]
+ [CCode (cprefix = "GTK_ASSISTANT_PAGE_", cheader_filename = "gtk/gtk.h")]
public enum AssistantPageType {
CONTENT,
INTRO,
SUMMARY,
PROGRESS,
}
- [CCode (cprefix = "GTK_")]
+ [CCode (cprefix = "GTK_", cheader_filename = "gtk/gtk.h")]
public enum AttachOptions {
EXPAND,
SHRINK,
FILL,
}
- [CCode (cprefix = "GTK_BUILDER_ERROR_")]
+ [CCode (cprefix = "GTK_BUILDER_ERROR_", cheader_filename = "gtk/gtk.h")]
public enum BuilderError {
INVALID_TYPE_FUNCTION,
UNHANDLED_TAG,
INVALID_ATTRIBUTE,
INVALID_TAG,
}
- [CCode (cprefix = "GTK_BUTTONBOX_")]
+ [CCode (cprefix = "GTK_BUTTONBOX_", cheader_filename = "gtk/gtk.h")]
public enum ButtonBoxStyle {
DEFAULT_STYLE,
SPREAD,
END,
CENTER,
}
- [CCode (cprefix = "GTK_BUTTONS_")]
+ [CCode (cprefix = "GTK_BUTTONS_", cheader_filename = "gtk/gtk.h")]
public enum ButtonsType {
NONE,
OK,
YES_NO,
OK_CANCEL,
}
- [CCode (cprefix = "GTK_CALENDAR_")]
+ [CCode (cprefix = "GTK_CALENDAR_", cheader_filename = "gtk/gtk.h")]
public enum CalendarDisplayOptions {
SHOW_HEADING,
SHOW_DAY_NAMES,
SHOW_WEEK_NUMBERS,
WEEK_START_MONDAY,
}
- [CCode (cprefix = "GTK_CELL_RENDERER_ACCEL_MODE_")]
+ [CCode (cprefix = "GTK_CELL_RENDERER_ACCEL_MODE_", cheader_filename = "gtk/gtk.h")]
public enum CellRendererAccelMode {
GTK,
OTHER,
}
- [CCode (cprefix = "GTK_CELL_RENDERER_MODE_")]
+ [CCode (cprefix = "GTK_CELL_RENDERER_MODE_", cheader_filename = "gtk/gtk.h")]
public enum CellRendererMode {
INERT,
ACTIVATABLE,
EDITABLE,
}
- [CCode (cprefix = "GTK_CELL_RENDERER_")]
+ [CCode (cprefix = "GTK_CELL_RENDERER_", cheader_filename = "gtk/gtk.h")]
public enum CellRendererState {
SELECTED,
PRELIT,
SORTED,
FOCUSED,
}
- [CCode (cprefix = "GTK_CORNER_")]
+ [CCode (cprefix = "GTK_CORNER_", cheader_filename = "gtk/gtk.h")]
public enum CornerType {
TOP_LEFT,
BOTTOM_LEFT,
TOP_RIGHT,
BOTTOM_RIGHT,
}
- [CCode (cprefix = "GTK_CURVE_TYPE_")]
+ [CCode (cprefix = "GTK_CURVE_TYPE_", cheader_filename = "gtk/gtk.h")]
public enum CurveType {
LINEAR,
SPLINE,
FREE,
}
- [CCode (cprefix = "GTK_DEBUG_")]
+ [CCode (cprefix = "GTK_DEBUG_", cheader_filename = "gtk/gtk.h")]
public enum DebugFlag {
MISC,
PLUGSOCKET,
PRINTING,
BUILDER,
}
- [CCode (cprefix = "GTK_DELETE_")]
+ [CCode (cprefix = "GTK_DELETE_", cheader_filename = "gtk/gtk.h")]
public enum DeleteType {
CHARS,
WORD_ENDS,
PARAGRAPHS,
WHITESPACE,
}
- [CCode (cprefix = "GTK_DEST_DEFAULT_")]
+ [CCode (cprefix = "GTK_DEST_DEFAULT_", cheader_filename = "gtk/gtk.h")]
public enum DestDefaults {
MOTION,
HIGHLIGHT,
DROP,
ALL,
}
- [CCode (cprefix = "GTK_DIALOG_")]
+ [CCode (cprefix = "GTK_DIALOG_", cheader_filename = "gtk/gtk.h")]
public enum DialogFlags {
MODAL,
DESTROY_WITH_PARENT,
NO_SEPARATOR,
}
- [CCode (cprefix = "GTK_DIR_")]
+ [CCode (cprefix = "GTK_DIR_", cheader_filename = "gtk/gtk.h")]
public enum DirectionType {
TAB_FORWARD,
TAB_BACKWARD,
LEFT,
RIGHT,
}
- [CCode (cprefix = "GTK_DRAG_RESULT_")]
+ [CCode (cprefix = "GTK_DRAG_RESULT_", cheader_filename = "gtk/gtk.h")]
public enum DragResult {
SUCCESS,
NO_TARGET,
GRAB_BROKEN,
ERROR,
}
- [CCode (cprefix = "GTK_EXPANDER_")]
+ [CCode (cprefix = "GTK_EXPANDER_", cheader_filename = "gtk/gtk.h")]
public enum ExpanderStyle {
COLLAPSED,
SEMI_COLLAPSED,
SEMI_EXPANDED,
EXPANDED,
}
- [CCode (cprefix = "GTK_FILE_CHOOSER_ACTION_")]
+ [CCode (cprefix = "GTK_FILE_CHOOSER_ACTION_", cheader_filename = "gtk/gtk.h")]
public enum FileChooserAction {
OPEN,
SAVE,
SELECT_FOLDER,
CREATE_FOLDER,
}
- [CCode (cprefix = "GTK_FILE_CHOOSER_CONFIRMATION_")]
+ [CCode (cprefix = "GTK_FILE_CHOOSER_CONFIRMATION_", cheader_filename = "gtk/gtk.h")]
public enum FileChooserConfirmation {
CONFIRM,
ACCEPT_FILENAME,
SELECT_AGAIN,
}
- [CCode (cprefix = "GTK_FILE_CHOOSER_ERROR_")]
+ [CCode (cprefix = "GTK_FILE_CHOOSER_ERROR_", cheader_filename = "gtk/gtk.h")]
public enum FileChooserError {
NONEXISTENT,
BAD_FILENAME,
ALREADY_EXISTS,
}
- [CCode (cprefix = "GTK_FILE_FILTER_")]
+ [CCode (cprefix = "GTK_FILE_FILTER_", cheader_filename = "gtk/gtk.h")]
public enum FileFilterFlags {
FILENAME,
URI,
DISPLAY_NAME,
MIME_TYPE,
}
- [CCode (cprefix = "GTK_IM_PREEDIT_")]
+ [CCode (cprefix = "GTK_IM_PREEDIT_", cheader_filename = "gtk/gtk.h")]
public enum IMPreeditStyle {
NOTHING,
CALLBACK,
NONE,
}
- [CCode (cprefix = "GTK_IM_STATUS_")]
+ [CCode (cprefix = "GTK_IM_STATUS_", cheader_filename = "gtk/gtk.h")]
public enum IMStatusStyle {
NOTHING,
CALLBACK,
NONE,
}
- [CCode (cprefix = "GTK_ICON_LOOKUP_")]
+ [CCode (cprefix = "GTK_ICON_LOOKUP_", cheader_filename = "gtk/gtk.h")]
public enum IconLookupFlags {
NO_SVG,
FORCE_SVG,
USE_BUILTIN,
GENERIC_FALLBACK,
}
- [CCode (cprefix = "GTK_ICON_SIZE_")]
+ [CCode (cprefix = "GTK_ICON_SIZE_", cheader_filename = "gtk/gtk.h")]
public enum IconSize {
INVALID,
MENU,
DND,
DIALOG,
}
- [CCode (cprefix = "GTK_ICON_THEME_")]
+ [CCode (cprefix = "GTK_ICON_THEME_", cheader_filename = "gtk/gtk.h")]
public enum IconThemeError {
NOT_FOUND,
FAILED,
}
- [CCode (cprefix = "GTK_ICON_VIEW_")]
+ [CCode (cprefix = "GTK_ICON_VIEW_", cheader_filename = "gtk/gtk.h")]
public enum IconViewDropPosition {
NO_DROP,
DROP_INTO,
DROP_ABOVE,
DROP_BELOW,
}
- [CCode (cprefix = "GTK_IMAGE_")]
+ [CCode (cprefix = "GTK_IMAGE_", cheader_filename = "gtk/gtk.h")]
public enum ImageType {
EMPTY,
PIXMAP,
ANIMATION,
ICON_NAME,
}
- [CCode (cprefix = "GTK_JUSTIFY_")]
+ [CCode (cprefix = "GTK_JUSTIFY_", cheader_filename = "gtk/gtk.h")]
public enum Justification {
LEFT,
RIGHT,
CENTER,
FILL,
}
- [CCode (cprefix = "GTK_MATCH_")]
+ [CCode (cprefix = "GTK_MATCH_", cheader_filename = "gtk/gtk.h")]
public enum MatchType {
ALL,
ALL_TAIL,
EXACT,
LAST,
}
- [CCode (cprefix = "GTK_MENU_DIR_")]
+ [CCode (cprefix = "GTK_MENU_DIR_", cheader_filename = "gtk/gtk.h")]
public enum MenuDirectionType {
PARENT,
CHILD,
NEXT,
PREV,
}
- [CCode (cprefix = "GTK_MESSAGE_")]
+ [CCode (cprefix = "GTK_MESSAGE_", cheader_filename = "gtk/gtk.h")]
public enum MessageType {
INFO,
WARNING,
ERROR,
OTHER,
}
- [CCode (cprefix = "GTK_")]
+ [CCode (cprefix = "GTK_", cheader_filename = "gtk/gtk.h")]
public enum MetricType {
PIXELS,
INCHES,
CENTIMETERS,
}
- [CCode (cprefix = "GTK_MOVEMENT_")]
+ [CCode (cprefix = "GTK_MOVEMENT_", cheader_filename = "gtk/gtk.h")]
public enum MovementStep {
LOGICAL_POSITIONS,
VISUAL_POSITIONS,
BUFFER_ENDS,
HORIZONTAL_PAGES,
}
- [CCode (cprefix = "GTK_NOTEBOOK_TAB_")]
+ [CCode (cprefix = "GTK_NOTEBOOK_TAB_", cheader_filename = "gtk/gtk.h")]
public enum NotebookTab {
FIRST,
LAST,
}
- [CCode (cprefix = "GTK_")]
+ [CCode (cprefix = "GTK_", cheader_filename = "gtk/gtk.h")]
public enum ObjectFlags {
IN_DESTRUCTION,
FLOATING,
RESERVED_1,
RESERVED_2,
}
- [CCode (cprefix = "GTK_ORIENTATION_")]
+ [CCode (cprefix = "GTK_ORIENTATION_", cheader_filename = "gtk/gtk.h")]
public enum Orientation {
HORIZONTAL,
VERTICAL,
}
- [CCode (cprefix = "GTK_PACK_DIRECTION_")]
+ [CCode (cprefix = "GTK_PACK_DIRECTION_", cheader_filename = "gtk/gtk.h")]
public enum PackDirection {
LTR,
RTL,
TTB,
BTT,
}
- [CCode (cprefix = "GTK_PACK_")]
+ [CCode (cprefix = "GTK_PACK_", cheader_filename = "gtk/gtk.h")]
public enum PackType {
START,
END,
}
- [CCode (cprefix = "GTK_PAGE_ORIENTATION_")]
+ [CCode (cprefix = "GTK_PAGE_ORIENTATION_", cheader_filename = "gtk/gtk.h")]
public enum PageOrientation {
PORTRAIT,
LANDSCAPE,
REVERSE_PORTRAIT,
REVERSE_LANDSCAPE,
}
- [CCode (cprefix = "GTK_PAGE_SET_")]
+ [CCode (cprefix = "GTK_PAGE_SET_", cheader_filename = "gtk/gtk.h")]
public enum PageSet {
ALL,
EVEN,
ODD,
}
- [CCode (cprefix = "GTK_PATH_PRIO_")]
+ [CCode (cprefix = "GTK_PATH_PRIO_", cheader_filename = "gtk/gtk.h")]
public enum PathPriorityType {
LOWEST,
GTK,
RC,
HIGHEST,
}
- [CCode (cprefix = "GTK_PATH_")]
+ [CCode (cprefix = "GTK_PATH_", cheader_filename = "gtk/gtk.h")]
public enum PathType {
WIDGET,
WIDGET_CLASS,
CLASS,
}
- [CCode (cprefix = "GTK_POLICY_")]
+ [CCode (cprefix = "GTK_POLICY_", cheader_filename = "gtk/gtk.h")]
public enum PolicyType {
ALWAYS,
AUTOMATIC,
NEVER,
}
- [CCode (cprefix = "GTK_POS_")]
+ [CCode (cprefix = "GTK_POS_", cheader_filename = "gtk/gtk.h")]
public enum PositionType {
LEFT,
RIGHT,
TOP,
BOTTOM,
}
- [CCode (cprefix = "GTK_PREVIEW_")]
+ [CCode (cprefix = "GTK_PREVIEW_", cheader_filename = "gtk/gtk.h")]
public enum PreviewType {
COLOR,
GRAYSCALE,
}
- [CCode (cprefix = "GTK_PRINT_BACKEND_ERROR_")]
+ [CCode (cprefix = "GTK_PRINT_BACKEND_ERROR_", cheader_filename = "gtk/gtk.h")]
public enum PrintBackendError {
GENERIC,
}
- [CCode (cprefix = "GTK_PRINT_CAPABILITY_")]
+ [CCode (cprefix = "GTK_PRINT_CAPABILITY_", cheader_filename = "gtk/gtk.h")]
public enum PrintCapabilities {
PAGE_SET,
COPIES,
PREVIEW,
NUMBER_UP,
}
- [CCode (cprefix = "GTK_PRINT_DUPLEX_")]
+ [CCode (cprefix = "GTK_PRINT_DUPLEX_", cheader_filename = "gtk/gtk.h")]
public enum PrintDuplex {
SIMPLEX,
HORIZONTAL,
VERTICAL,
}
- [CCode (cprefix = "GTK_PRINT_ERROR_")]
+ [CCode (cprefix = "GTK_PRINT_ERROR_", cheader_filename = "gtk/gtk.h")]
public enum PrintError {
GENERAL,
INTERNAL_ERROR,
NOMEM,
INVALID_FILE,
}
- [CCode (cprefix = "GTK_PRINT_OPERATION_ACTION_")]
+ [CCode (cprefix = "GTK_PRINT_OPERATION_ACTION_", cheader_filename = "gtk/gtk.h")]
public enum PrintOperationAction {
PRINT_DIALOG,
PRINT,
PREVIEW,
EXPORT,
}
- [CCode (cprefix = "GTK_PRINT_OPERATION_RESULT_")]
+ [CCode (cprefix = "GTK_PRINT_OPERATION_RESULT_", cheader_filename = "gtk/gtk.h")]
public enum PrintOperationResult {
ERROR,
APPLY,
CANCEL,
IN_PROGRESS,
}
- [CCode (cprefix = "GTK_PRINT_PAGES_")]
+ [CCode (cprefix = "GTK_PRINT_PAGES_", cheader_filename = "gtk/gtk.h")]
public enum PrintPages {
ALL,
CURRENT,
RANGES,
}
- [CCode (cprefix = "GTK_PRINT_QUALITY_")]
+ [CCode (cprefix = "GTK_PRINT_QUALITY_", cheader_filename = "gtk/gtk.h")]
public enum PrintQuality {
LOW,
NORMAL,
HIGH,
DRAFT,
}
- [CCode (cprefix = "GTK_PRINT_STATUS_")]
+ [CCode (cprefix = "GTK_PRINT_STATUS_", cheader_filename = "gtk/gtk.h")]
public enum PrintStatus {
INITIAL,
PREPARING,
FINISHED,
FINISHED_ABORTED,
}
- [CCode (cprefix = "GTK_PRINTER_OPTION_TYPE_")]
+ [CCode (cprefix = "GTK_PRINTER_OPTION_TYPE_", cheader_filename = "gtk/gtk.h")]
public enum PrinterOptionType {
BOOLEAN,
PICKONE,
STRING,
FILESAVE,
}
- [CCode (cprefix = "GTK_PROGRESS_")]
+ [CCode (cprefix = "GTK_PROGRESS_", cheader_filename = "gtk/gtk.h")]
public enum ProgressBarOrientation {
LEFT_TO_RIGHT,
RIGHT_TO_LEFT,
BOTTOM_TO_TOP,
TOP_TO_BOTTOM,
}
- [CCode (cprefix = "GTK_PROGRESS_")]
+ [CCode (cprefix = "GTK_PROGRESS_", cheader_filename = "gtk/gtk.h")]
public enum ProgressBarStyle {
CONTINUOUS,
DISCRETE,
}
- [CCode (cprefix = "GTK_RC_")]
+ [CCode (cprefix = "GTK_RC_", cheader_filename = "gtk/gtk.h")]
public enum RcFlags {
FG,
BG,
TEXT,
BASE,
}
- [CCode (cprefix = "GTK_RC_TOKEN_")]
+ [CCode (cprefix = "GTK_RC_TOKEN_", cheader_filename = "gtk/gtk.h")]
public enum RcTokenType {
INVALID,
INCLUDE,
UNBIND,
LAST,
}
- [CCode (cprefix = "GTK_RECENT_CHOOSER_ERROR_")]
+ [CCode (cprefix = "GTK_RECENT_CHOOSER_ERROR_", cheader_filename = "gtk/gtk.h")]
public enum RecentChooserError {
NOT_FOUND,
INVALID_URI,
}
- [CCode (cprefix = "GTK_RECENT_CHOOSER_PROP_")]
+ [CCode (cprefix = "GTK_RECENT_CHOOSER_PROP_", cheader_filename = "gtk/gtk.h")]
public enum RecentChooserProp {
FIRST,
RECENT_MANAGER,
FILTER,
LAST,
}
- [CCode (cprefix = "GTK_RECENT_FILTER_")]
+ [CCode (cprefix = "GTK_RECENT_FILTER_", cheader_filename = "gtk/gtk.h")]
public enum RecentFilterFlags {
URI,
DISPLAY_NAME,
GROUP,
AGE,
}
- [CCode (cprefix = "GTK_RECENT_MANAGER_ERROR_")]
+ [CCode (cprefix = "GTK_RECENT_MANAGER_ERROR_", cheader_filename = "gtk/gtk.h")]
public enum RecentManagerError {
NOT_FOUND,
INVALID_URI,
WRITE,
UNKNOWN,
}
- [CCode (cprefix = "GTK_RECENT_SORT_")]
+ [CCode (cprefix = "GTK_RECENT_SORT_", cheader_filename = "gtk/gtk.h")]
public enum RecentSortType {
NONE,
MRU,
LRU,
CUSTOM,
}
- [CCode (cprefix = "GTK_RELIEF_")]
+ [CCode (cprefix = "GTK_RELIEF_", cheader_filename = "gtk/gtk.h")]
public enum ReliefStyle {
NORMAL,
HALF,
NONE,
}
- [CCode (cprefix = "GTK_RESIZE_")]
+ [CCode (cprefix = "GTK_RESIZE_", cheader_filename = "gtk/gtk.h")]
public enum ResizeMode {
PARENT,
QUEUE,
IMMEDIATE,
}
- [CCode (cprefix = "GTK_RESPONSE_")]
+ [CCode (cprefix = "GTK_RESPONSE_", cheader_filename = "gtk/gtk.h")]
public enum ResponseType {
NONE,
REJECT,
APPLY,
HELP,
}
- [CCode (cprefix = "GTK_SCROLL_")]
+ [CCode (cprefix = "GTK_SCROLL_", cheader_filename = "gtk/gtk.h")]
public enum ScrollStep {
STEPS,
PAGES,
HORIZONTAL_PAGES,
HORIZONTAL_ENDS,
}
- [CCode (cprefix = "GTK_SCROLL_")]
+ [CCode (cprefix = "GTK_SCROLL_", cheader_filename = "gtk/gtk.h")]
public enum ScrollType {
NONE,
JUMP,
START,
END,
}
- [CCode (cprefix = "GTK_SELECTION_")]
+ [CCode (cprefix = "GTK_SELECTION_", cheader_filename = "gtk/gtk.h")]
public enum SelectionMode {
NONE,
SINGLE,
MULTIPLE,
EXTENDED,
}
- [CCode (cprefix = "GTK_SENSITIVITY_")]
+ [CCode (cprefix = "GTK_SENSITIVITY_", cheader_filename = "gtk/gtk.h")]
public enum SensitivityType {
AUTO,
ON,
OFF,
}
- [CCode (cprefix = "GTK_SHADOW_")]
+ [CCode (cprefix = "GTK_SHADOW_", cheader_filename = "gtk/gtk.h")]
public enum ShadowType {
NONE,
IN,
ETCHED_IN,
ETCHED_OUT,
}
- [CCode (cprefix = "GTK_SIDE_")]
+ [CCode (cprefix = "GTK_SIDE_", cheader_filename = "gtk/gtk.h")]
public enum SideType {
TOP,
BOTTOM,
LEFT,
RIGHT,
}
- [CCode (cprefix = "GTK_RUN_")]
+ [CCode (cprefix = "GTK_RUN_", cheader_filename = "gtk/gtk.h")]
public enum SignalRunType {
FIRST,
LAST,
ACTION,
NO_HOOKS,
}
- [CCode (cprefix = "GTK_SIZE_GROUP_")]
+ [CCode (cprefix = "GTK_SIZE_GROUP_", cheader_filename = "gtk/gtk.h")]
public enum SizeGroupMode {
NONE,
HORIZONTAL,
VERTICAL,
BOTH,
}
- [CCode (cprefix = "GTK_SORT_")]
+ [CCode (cprefix = "GTK_SORT_", cheader_filename = "gtk/gtk.h")]
public enum SortType {
ASCENDING,
DESCENDING,
}
- [CCode (cprefix = "GTK_UPDATE_")]
+ [CCode (cprefix = "GTK_UPDATE_", cheader_filename = "gtk/gtk.h")]
public enum SpinButtonUpdatePolicy {
ALWAYS,
IF_VALID,
}
- [CCode (cprefix = "GTK_SPIN_")]
+ [CCode (cprefix = "GTK_SPIN_", cheader_filename = "gtk/gtk.h")]
public enum SpinType {
STEP_FORWARD,
STEP_BACKWARD,
END,
USER_DEFINED,
}
- [CCode (cprefix = "GTK_STATE_")]
+ [CCode (cprefix = "GTK_STATE_", cheader_filename = "gtk/gtk.h")]
public enum StateType {
NORMAL,
ACTIVE,
SELECTED,
INSENSITIVE,
}
- [CCode (cprefix = "GTK_DIRECTION_")]
+ [CCode (cprefix = "GTK_DIRECTION_", cheader_filename = "gtk/gtk.h")]
public enum SubmenuDirection {
LEFT,
RIGHT,
}
- [CCode (cprefix = "GTK_")]
+ [CCode (cprefix = "GTK_", cheader_filename = "gtk/gtk.h")]
public enum SubmenuPlacement {
TOP_BOTTOM,
LEFT_RIGHT,
}
- [CCode (cprefix = "GTK_TARGET_")]
+ [CCode (cprefix = "GTK_TARGET_", cheader_filename = "gtk/gtk.h")]
public enum TargetFlags {
SAME_APP,
SAME_WIDGET,
OTHER_APP,
OTHER_WIDGET,
}
- [CCode (cprefix = "GTK_TEXT_BUFFER_TARGET_INFO_")]
+ [CCode (cprefix = "GTK_TEXT_BUFFER_TARGET_INFO_", cheader_filename = "gtk/gtk.h")]
public enum TextBufferTargetInfo {
BUFFER_CONTENTS,
RICH_TEXT,
TEXT,
}
- [CCode (cprefix = "GTK_TEXT_DIR_")]
+ [CCode (cprefix = "GTK_TEXT_DIR_", cheader_filename = "gtk/gtk.h")]
public enum TextDirection {
NONE,
LTR,
RTL,
}
- [CCode (cprefix = "GTK_TEXT_SEARCH_")]
+ [CCode (cprefix = "GTK_TEXT_SEARCH_", cheader_filename = "gtk/gtk.h")]
public enum TextSearchFlags {
VISIBLE_ONLY,
TEXT_ONLY,
}
- [CCode (cprefix = "GTK_TEXT_WINDOW_")]
+ [CCode (cprefix = "GTK_TEXT_WINDOW_", cheader_filename = "gtk/gtk.h")]
public enum TextWindowType {
PRIVATE,
WIDGET,
TOP,
BOTTOM,
}
- [CCode (cprefix = "GTK_TOOLBAR_CHILD_")]
+ [CCode (cprefix = "GTK_TOOLBAR_CHILD_", cheader_filename = "gtk/gtk.h")]
public enum ToolbarChildType {
SPACE,
BUTTON,
RADIOBUTTON,
WIDGET,
}
- [CCode (cprefix = "GTK_TOOLBAR_SPACE_")]
+ [CCode (cprefix = "GTK_TOOLBAR_SPACE_", cheader_filename = "gtk/gtk.h")]
public enum ToolbarSpaceStyle {
EMPTY,
LINE,
}
- [CCode (cprefix = "GTK_TOOLBAR_")]
+ [CCode (cprefix = "GTK_TOOLBAR_", cheader_filename = "gtk/gtk.h")]
public enum ToolbarStyle {
ICONS,
TEXT,
BOTH,
BOTH_HORIZ,
}
- [CCode (cprefix = "GTK_TREE_MODEL_")]
+ [CCode (cprefix = "GTK_TREE_MODEL_", cheader_filename = "gtk/gtk.h")]
public enum TreeModelFlags {
ITERS_PERSIST,
LIST_ONLY,
}
- [CCode (cprefix = "GTK_TREE_VIEW_COLUMN_")]
+ [CCode (cprefix = "GTK_TREE_VIEW_COLUMN_", cheader_filename = "gtk/gtk.h")]
public enum TreeViewColumnSizing {
GROW_ONLY,
AUTOSIZE,
FIXED,
}
- [CCode (cprefix = "GTK_TREE_VIEW_DROP_")]
+ [CCode (cprefix = "GTK_TREE_VIEW_DROP_", cheader_filename = "gtk/gtk.h")]
public enum TreeViewDropPosition {
BEFORE,
AFTER,
INTO_OR_BEFORE,
INTO_OR_AFTER,
}
- [CCode (cprefix = "GTK_TREE_VIEW_GRID_LINES_")]
+ [CCode (cprefix = "GTK_TREE_VIEW_GRID_LINES_", cheader_filename = "gtk/gtk.h")]
public enum TreeViewGridLines {
NONE,
HORIZONTAL,
VERTICAL,
BOTH,
}
- [CCode (cprefix = "GTK_UI_MANAGER_")]
+ [CCode (cprefix = "GTK_UI_MANAGER_", cheader_filename = "gtk/gtk.h")]
public enum UIManagerItemType {
AUTO,
MENUBAR,
SEPARATOR,
ACCELERATOR,
}
- [CCode (cprefix = "GTK_UNIT_")]
+ [CCode (cprefix = "GTK_UNIT_", cheader_filename = "gtk/gtk.h")]
public enum Unit {
PIXEL,
POINTS,
INCH,
MM,
}
- [CCode (cprefix = "GTK_UPDATE_")]
+ [CCode (cprefix = "GTK_UPDATE_", cheader_filename = "gtk/gtk.h")]
public enum UpdateType {
CONTINUOUS,
DISCONTINUOUS,
DELAYED,
}
- [CCode (cprefix = "GTK_VISIBILITY_")]
+ [CCode (cprefix = "GTK_VISIBILITY_", cheader_filename = "gtk/gtk.h")]
public enum Visibility {
NONE,
PARTIAL,
FULL,
}
- [CCode (cprefix = "GTK_")]
+ [CCode (cprefix = "GTK_", cheader_filename = "gtk/gtk.h")]
public enum WidgetFlags {
TOPLEVEL,
NO_WINDOW,
DOUBLE_BUFFERED,
NO_SHOW_ALL,
}
- [CCode (cprefix = "GTK_WIDGET_HELP_")]
+ [CCode (cprefix = "GTK_WIDGET_HELP_", cheader_filename = "gtk/gtk.h")]
public enum WidgetHelpType {
TOOLTIP,
WHATS_THIS,
}
- [CCode (cprefix = "GTK_WIN32_EMBED_")]
+ [CCode (cprefix = "GTK_WIN32_EMBED_", cheader_filename = "gtk/gtk.h")]
public enum Win32EmbedMessageType {
WINDOW_ACTIVATE,
WINDOW_DEACTIVATE,
UNGRAB_KEY,
LAST,
}
- [CCode (cprefix = "GTK_WIN_POS_")]
+ [CCode (cprefix = "GTK_WIN_POS_", cheader_filename = "gtk/gtk.h")]
public enum WindowPosition {
NONE,
CENTER,
CENTER_ALWAYS,
CENTER_ON_PARENT,
}
- [CCode (cprefix = "GTK_WINDOW_")]
+ [CCode (cprefix = "GTK_WINDOW_", cheader_filename = "gtk/gtk.h")]
public enum WindowType {
TOPLEVEL,
POPUP,
}
- [CCode (cprefix = "GTK_WRAP_")]
+ [CCode (cprefix = "GTK_WRAP_", cheader_filename = "gtk/gtk.h")]
public enum WrapMode {
NONE,
CHAR,
public Calendar ();
public void select_day (uint day);
public bool select_month (uint month, uint year);
- public void set_display_options (Gtk.CalendarDisplayOptions @flags);
+ public void set_display_options (Gtk.CalendarDisplayOptions flags);
public bool unmark_day (uint day);
[NoAccessorMethod]
public weak int year { get; set; }
}
[CCode (cheader_filename = "gtk/gtk.h")]
public class CellRenderer : Gtk.Object {
- public virtual bool activate (Gdk.Event event, Gtk.Widget widget, string path, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gtk.CellRendererState @flags);
+ public virtual bool activate (Gdk.Event event, Gtk.Widget widget, string path, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gtk.CellRendererState flags);
public void get_fixed_size (int width, int height);
public virtual void get_size (Gtk.Widget widget, Gdk.Rectangle cell_area, int x_offset, int y_offset, int width, int height);
public static GLib.Type get_type ();
- public virtual void render (Gdk.Window window, Gtk.Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, Gtk.CellRendererState @flags);
+ public virtual void render (Gdk.Window window, Gtk.Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, Gtk.CellRendererState flags);
public void set_fixed_size (int width, int height);
- public virtual weak Gtk.CellEditable start_editing (Gdk.Event event, Gtk.Widget widget, string path, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gtk.CellRendererState @flags);
+ public virtual weak Gtk.CellEditable start_editing (Gdk.Event event, Gtk.Widget widget, string path, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gtk.CellRendererState flags);
public void stop_editing (bool canceled);
[NoAccessorMethod]
public weak Gtk.CellRendererMode mode { get; set; }
public static weak Gtk.Clipboard get_for_display (Gdk.Display display, Gdk.Atom selection);
public weak GLib.Object get_owner ();
public static GLib.Type get_type ();
- public void request_contents (Gdk.Atom target, Gtk.ClipboardReceivedFunc @callback, pointer user_data);
- public void request_image (Gtk.ClipboardImageReceivedFunc @callback, pointer user_data);
- public void request_rich_text (Gtk.TextBuffer buffer, Gtk.ClipboardRichTextReceivedFunc @callback, pointer user_data);
- public void request_targets (Gtk.ClipboardTargetsReceivedFunc @callback, pointer user_data);
- public void request_text (Gtk.ClipboardTextReceivedFunc @callback, pointer user_data);
+ public void request_contents (Gdk.Atom target, Gtk.ClipboardReceivedFunc callback, pointer user_data);
+ public void request_image (Gtk.ClipboardImageReceivedFunc callback, pointer user_data);
+ public void request_rich_text (Gtk.TextBuffer buffer, Gtk.ClipboardRichTextReceivedFunc callback, pointer user_data);
+ public void request_targets (Gtk.ClipboardTargetsReceivedFunc callback, pointer user_data);
+ public void request_text (Gtk.ClipboardTextReceivedFunc callback, pointer user_data);
[NoArrayLength]
public void set_can_store (Gtk.TargetEntry[] targets, int n_targets);
public void set_image (Gdk.Pixbuf pixbuf);
public static weak GLib.ParamSpec class_find_child_property (pointer cclass, string property_name);
public static void class_install_child_property (pointer cclass, uint property_id, GLib.ParamSpec pspec);
public static weak GLib.ParamSpec class_list_child_properties (pointer cclass, uint n_properties);
- public virtual void forall (Gtk.Callback @callback, pointer callback_data);
- public void @foreach (Gtk.Callback @callback, pointer callback_data);
+ public virtual void forall (Gtk.Callback callback, pointer callback_data);
+ public void @foreach (Gtk.Callback callback, pointer callback_data);
public uint get_border_width ();
public weak GLib.List get_children ();
public bool get_focus_chain (GLib.List focusable_widgets);
public int get_response_for_widget (Gtk.Widget widget);
public static GLib.Type get_type ();
public Dialog ();
- public Dialog.with_buttons (string title, Gtk.Window parent, Gtk.DialogFlags @flags, ...);
+ public Dialog.with_buttons (string title, Gtk.Window parent, Gtk.DialogFlags flags, ...);
public int run ();
public void set_alternative_button_order (...);
public void set_alternative_button_order_from_array (int n_params, int new_order);
public static void add_builtin_icon (string icon_name, int size, Gdk.Pixbuf pixbuf);
public void append_search_path (string path);
[NoArrayLength]
- public weak Gtk.IconInfo choose_icon (string[] icon_names, int size, Gtk.IconLookupFlags @flags);
+ public weak Gtk.IconInfo choose_icon (string[] icon_names, int size, Gtk.IconLookupFlags flags);
public static GLib.Quark error_quark ();
public static weak Gtk.IconTheme get_default ();
public weak string get_example_icon_name ();
public bool has_icon (string icon_name);
public weak GLib.List list_contexts ();
public weak GLib.List list_icons (string context);
- public weak Gdk.Pixbuf load_icon (string icon_name, int size, Gtk.IconLookupFlags @flags, GLib.Error error);
- public weak Gtk.IconInfo lookup_icon (string icon_name, int size, Gtk.IconLookupFlags @flags);
+ public weak Gdk.Pixbuf load_icon (string icon_name, int size, Gtk.IconLookupFlags flags, GLib.Error error);
+ public weak Gtk.IconInfo lookup_icon (string icon_name, int size, Gtk.IconLookupFlags flags);
public IconTheme ();
public void prepend_search_path (string path);
public bool rescan_if_needed ();
public void format_secondary_markup (string message_format);
public void format_secondary_text (string message_format);
public static GLib.Type get_type ();
- public MessageDialog (Gtk.Window parent, Gtk.DialogFlags @flags, Gtk.MessageType type, Gtk.ButtonsType buttons, string message_format);
- public MessageDialog.with_markup (Gtk.Window parent, Gtk.DialogFlags @flags, Gtk.MessageType type, Gtk.ButtonsType buttons, string message_format);
+ public MessageDialog (Gtk.Window parent, Gtk.DialogFlags flags, Gtk.MessageType type, Gtk.ButtonsType buttons, string message_format);
+ public MessageDialog.with_markup (Gtk.Window parent, Gtk.DialogFlags flags, Gtk.MessageType type, Gtk.ButtonsType buttons, string message_format);
public void set_image (Gtk.Widget image);
public void set_markup (string str);
[NoAccessorMethod]
public weak GLib.List get_printer_list ();
public static GLib.Type get_type ();
public static weak GLib.List load_modules ();
- public virtual void print_stream (Gtk.PrintJob job, GLib.IOChannel data_io, Gtk.PrintJobCompleteFunc @callback, pointer user_data, GLib.DestroyNotify dnotify);
+ public virtual void print_stream (Gtk.PrintJob job, GLib.IOChannel data_io, Gtk.PrintJobCompleteFunc callback, pointer user_data, GLib.DestroyNotify dnotify);
public bool printer_list_is_done ();
public void remove_printer (Gtk.Printer printer);
public void set_list_done ();
public bool get_track_print_status ();
public static GLib.Type get_type ();
public PrintJob (string title, Gtk.Printer printer, Gtk.PrintSettings settings, Gtk.PageSetup page_setup);
- public void send (Gtk.PrintJobCompleteFunc @callback, pointer user_data, GLib.DestroyNotify dnotify);
+ public void send (Gtk.PrintJobCompleteFunc callback, pointer user_data, GLib.DestroyNotify dnotify);
public bool set_source_file (string filename, GLib.Error error);
public void set_track_print_status (bool track_status);
[NoAccessorMethod]
[HasEmitter]
public signal void sort_column_changed ();
}
+ [CCode (cheader_filename = "gtk/gtk.h")]
+ public struct Allocation {
+ public int x;
+ public int y;
+ public int width;
+ public int height;
+ }
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct CacheInfo {
public weak string cache;
public ulong cache_size;
public uint n_directories;
- public int @flags;
+ public int flags;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct AccelGroupEntry {
public weak Gtk.AccelKey key;
public GLib.Closure closure;
public GLib.Quark accel_path_quark;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct AccelKey {
public uint accel_key;
public Gdk.ModifierType accel_mods;
public uint accel_flags;
}
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct ActionEntry {
public weak string name;
public weak string stock_id;
public weak string label;
public weak string accelerator;
public weak string tooltip;
- public GLib.Callback @callback;
+ public GLib.Callback callback;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct BindingArg {
public GLib.Type arg_type;
public long long_data;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct BindingEntry {
public uint keyval;
public Gdk.ModifierType modifiers;
public static void skip (Gtk.BindingSet binding_set, uint keyval, Gdk.ModifierType modifiers);
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct BindingSet {
public weak string set_name;
public int priority;
public BindingSet (string set_name);
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct BindingSignal {
public weak Gtk.BindingSignal next;
public weak string signal_name;
public uint n_args;
public weak Gtk.BindingArg args;
}
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct Border {
public int left;
public int right;
public static GLib.Type get_type ();
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct BoxChild {
public weak Gtk.Widget widget;
public ushort padding;
public uint is_secondary;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct FileFilterInfo {
public Gtk.FileFilterFlags contains;
public weak string filename;
public weak string mime_type;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct FixedChild {
public weak Gtk.Widget widget;
public int x;
public int y;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct IMContextInfo {
public weak string context_id;
public weak string context_name;
public weak string default_locales;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct IconInfo {
public weak Gtk.IconInfo copy ();
public void free ();
public void set_raw_coordinates (bool raw_coordinates);
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct IconSet {
public void add_source (Gtk.IconSource source);
public weak Gtk.IconSet copy ();
public void unref ();
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct IconSource {
public weak Gtk.IconSource copy ();
public void free ();
public void set_state_wildcarded (bool setting);
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct ImageAnimationData {
public weak Gdk.PixbufAnimation anim;
public weak Gdk.PixbufAnimationIter iter;
public uint frame_timeout;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct ImageIconNameData {
public weak string icon_name;
public weak Gdk.Pixbuf pixbuf;
public uint theme_change_id;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct ImageIconSetData {
public weak Gtk.IconSet icon_set;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct ImageImageData {
public weak Gdk.Image image;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct ImagePixbufData {
public weak Gdk.Pixbuf pixbuf;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct ImagePixmapData {
public weak Gdk.Pixmap pixmap;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct ImageStockData {
public weak string stock_id;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct KeyHash {
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct LabelSelectionInfo {
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct MenuEntry {
public weak string path;
public weak string accelerator;
- public Gtk.MenuCallback @callback;
+ public Gtk.MenuCallback callback;
public pointer callback_data;
public weak Gtk.Widget widget;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct MnemonicHash {
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct NotebookPage {
public static int num (Gtk.Notebook notebook, Gtk.Widget child);
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct PageRange {
public int start;
public int end;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct PaperSize {
public weak Gtk.PaperSize copy ();
public void free ();
public void to_key_file (GLib.KeyFile key_file, string group_name);
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct PrintWin32Devnames {
public weak string driver;
public weak string device;
public weak string output;
- public int @flags;
+ public int flags;
public void free ();
public static pointer from_printer_name (string printer);
public static weak Gtk.PrintWin32Devnames from_win32 (pointer global);
public pointer to_win32 ();
}
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct RadioActionEntry {
public weak string name;
public weak string stock_id;
public int value;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct RangeLayout {
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct RangeStepTimer {
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct RcContext {
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct RcProperty {
public GLib.Quark type_name;
public GLib.Quark property_name;
public static bool parse_requisition (GLib.ParamSpec pspec, GLib.String gstring, GLib.Value property_value);
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct RecentData {
public weak string display_name;
public weak string description;
public bool is_private;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct RecentFilterInfo {
public Gtk.RecentFilterFlags contains;
public weak string uri;
public int age;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct RecentInfo {
public bool exists ();
public ulong get_added ();
public weak Gtk.RecentInfo @ref ();
public void unref ();
}
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct Requisition {
public int width;
public int height;
public static GLib.Type get_type ();
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct RulerMetric {
public weak string metric_name;
public weak string abbrev;
public int subdivide;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct SelectionData {
public Gdk.Atom selection;
public Gdk.Atom target;
public bool targets_include_uri ();
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct SettingsPropertyValue {
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct SettingsValue {
public weak string origin;
public weak GLib.Value value;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct StockItem {
public weak string stock_id;
public weak string label;
public void free ();
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct TableChild {
public weak Gtk.Widget widget;
public ushort left_attach;
public uint yfill;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct TableRowCol {
public ushort requisition;
public ushort allocation;
public uint empty;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct TargetEntry {
public weak string target;
- public uint @flags;
+ public uint flags;
public uint info;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct TargetList {
public weak GLib.List list;
public uint ref_count;
- public void add (Gdk.Atom target, uint @flags, uint info);
+ public void add (Gdk.Atom target, uint flags, uint info);
public void add_image_targets (uint info, bool writable);
public void add_rich_text_targets (uint info, bool deserializable, Gtk.TextBuffer buffer);
public void add_table (Gtk.TargetEntry targets, uint ntargets);
public void unref ();
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct TargetPair {
public Gdk.Atom target;
- public uint @flags;
+ public uint flags;
public uint info;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct TextAppearance {
public Gdk.Color bg_color;
public Gdk.Color fg_color;
public uint is_text;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct TextAttributes {
public weak Gtk.TextAppearance appearance;
public Gtk.Justification justification;
public void unref ();
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct TextBTree {
}
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct TextIter {
[InstanceByReference]
public bool backward_char ();
[InstanceByReference]
public bool backward_lines (int count);
[InstanceByReference]
- public bool backward_search (string str, Gtk.TextSearchFlags @flags, out Gtk.TextIter match_start, out Gtk.TextIter match_end, out Gtk.TextIter limit);
+ public bool backward_search (string str, Gtk.TextSearchFlags flags, out Gtk.TextIter match_start, out Gtk.TextIter match_end, out Gtk.TextIter limit);
[InstanceByReference]
public bool backward_sentence_start ();
[InstanceByReference]
[InstanceByReference]
public bool forward_lines (int count);
[InstanceByReference]
- public bool forward_search (string str, Gtk.TextSearchFlags @flags, out Gtk.TextIter match_start, out Gtk.TextIter match_end, out Gtk.TextIter limit);
+ public bool forward_search (string str, Gtk.TextSearchFlags flags, out Gtk.TextIter match_start, out Gtk.TextIter match_end, out Gtk.TextIter limit);
[InstanceByReference]
public bool forward_sentence_end ();
[InstanceByReference]
public bool toggles_tag (Gtk.TextTag tag);
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct TextLogAttrCache {
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct TextPendingScroll {
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct TextWindow {
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct ThemeEngine {
}
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct ToggleActionEntry {
public weak string name;
public weak string stock_id;
public weak string label;
public weak string accelerator;
public weak string tooltip;
- public GLib.Callback @callback;
+ public GLib.Callback callback;
public bool is_active;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct Tooltip {
public static GLib.Type get_type ();
public void set_custom (Gtk.Widget custom_widget);
public static void trigger_tooltip_query (Gdk.Display display);
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct TooltipsData {
public weak Gtk.Tooltips tooltips;
public weak Gtk.Widget widget;
public weak string tip_private;
public static weak Gtk.TooltipsData get (Gtk.Widget widget);
}
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct TreeIter {
public int stamp;
public pointer user_data;
public static GLib.Type get_type ();
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct TreePath {
public void append_index (int index_);
public int compare (Gtk.TreePath b);
public bool up ();
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct TreeRowReference {
public weak Gtk.TreeRowReference copy ();
public static void deleted (GLib.Object proxy, Gtk.TreePath path);
public bool valid ();
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct VolumeButtonClass {
public pointer parent_class;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct WidgetAuxInfo {
public int x;
public int y;
public uint y_set;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct WidgetShapeInfo {
public short offset_x;
public short offset_y;
public weak Gdk.Bitmap shape_mask;
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct WindowGeometryInfo {
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct Accel {
public static bool groups_activate (GLib.Object object, uint accel_key, Gdk.ModifierType accel_mods);
public static weak GLib.SList groups_from_object (GLib.Object object);
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct Accelerator {
public static uint get_default_mod_mask ();
public static weak string get_label (uint accelerator_key, Gdk.ModifierType accelerator_mods);
public static bool valid (uint keyval, Gdk.ModifierType modifiers);
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct Bindings {
public static bool activate (Gtk.Object object, uint keyval, Gdk.ModifierType modifiers);
public static bool activate_event (Gtk.Object object, Gdk.EventKey event);
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct Ctree {
public static GLib.Type expander_style_get_type ();
public static GLib.Type expansion_type_get_type ();
public static GLib.Type pos_get_type ();
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct Drag {
public static weak Gdk.DragContext begin (Gtk.Widget widget, Gtk.TargetList targets, Gdk.DragAction actions, int button, Gdk.Event event);
public static bool check_threshold (Gtk.Widget widget, int start_x, int start_y, int current_x, int current_y);
public static weak Gtk.TargetList dest_get_target_list (Gtk.Widget widget);
public static bool dest_get_track_motion (Gtk.Widget widget);
[NoArrayLength]
- public static void dest_set (Gtk.Widget widget, Gtk.DestDefaults @flags, Gtk.TargetEntry[] targets, int n_targets, Gdk.DragAction actions);
+ public static void dest_set (Gtk.Widget widget, Gtk.DestDefaults flags, Gtk.TargetEntry[] targets, int n_targets, Gdk.DragAction actions);
public static void dest_set_proxy (Gtk.Widget widget, Gdk.Window proxy_window, Gdk.DragProtocol protocol, bool use_coordinates);
public static void dest_set_target_list (Gtk.Widget widget, Gtk.TargetList target_list);
public static void dest_set_track_motion (Gtk.Widget widget, bool track_motion);
public static void unhighlight (Gtk.Widget widget);
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct Draw {
public static void insertion_cursor (Gtk.Widget widget, Gdk.Drawable drawable, Gdk.Rectangle area, Gdk.Rectangle location, bool is_primary, Gtk.TextDirection direction, bool draw_arrow);
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct Gc {
public static weak Gdk.GC get (int depth, Gdk.Colormap colormap, Gdk.GCValues values, Gdk.GCValuesMask values_mask);
public static void release (Gdk.GC gc);
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct Grab {
public static void add (Gtk.Widget widget);
public static weak Gtk.Widget get_current ();
public static void remove (Gtk.Widget widget);
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct Icon {
public static Gtk.IconSize size_from_name (string name);
public static weak string size_get_name (Gtk.IconSize size);
public static void size_register_alias (string alias, Gtk.IconSize target);
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct Idle {
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct Init {
public static void abi_check (int argc, string argv, int num_checks, ulong sizeof_GtkWindow, ulong sizeof_GtkBox);
public static void add (Gtk.Function function, pointer data);
public static bool with_args (int argc, string argv, string parameter_string, GLib.OptionEntry entries, string translation_domain, GLib.Error error);
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct Input {
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct Key {
public static uint snooper_install (Gtk.KeySnoopFunc snooper, pointer func_data);
public static void snooper_remove (uint snooper_handler_id);
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct Main {
public static void do_event (Gdk.Event event);
public static bool iteration ();
public static void quit ();
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct Print {
public static GLib.Quark error_quark ();
public static weak Gtk.PageSetup run_page_setup_dialog (Gtk.Window parent, Gtk.PageSetup page_setup, Gtk.PrintSettings settings);
public static void run_page_setup_dialog_async (Gtk.Window parent, Gtk.PageSetup page_setup, Gtk.PrintSettings settings, Gtk.PageSetupDoneFunc done_cb, pointer data);
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct Quit {
public static uint add (uint main_level, Gtk.Function function, pointer data);
public static void add_destroy (uint main_level, Gtk.Object object);
public static void remove_by_data (pointer data);
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct Rc {
public static void add_default_file (string filename);
public static weak string find_module_in_path (string module_file);
public static void set_default_files (string filenames);
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct Selection {
public static void add_target (Gtk.Widget widget, Gdk.Atom selection, Gdk.Atom target, uint info);
public static void add_targets (Gtk.Widget widget, Gdk.Atom selection, Gtk.TargetEntry targets, uint ntargets);
public static void remove_all (Gtk.Widget widget);
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct Signal {
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct Stock {
[NoArrayLength]
public static void add (Gtk.StockItem[] items, uint n_items);
public static void set_translate_func (string domain, Gtk.TranslateFunc func, pointer data, Gtk.DestroyNotify notify);
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct Target {
[NoArrayLength]
public static void table_free (Gtk.TargetEntry[] targets, int n_targets);
public static weak Gtk.TargetEntry table_new_from_list (Gtk.TargetList list, int n_targets);
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct Targets {
[NoArrayLength]
public static bool include_image (Gdk.Atom[] targets, int n_targets, bool writable);
public static bool include_uri (Gdk.Atom[] targets, int n_targets);
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct Timeout {
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct Tree {
public static bool get_row_drag_data (Gtk.SelectionData selection_data, Gtk.TreeModel tree_model, Gtk.TreePath path);
public static bool set_row_drag_data (Gtk.SelectionData selection_data, Gtk.TreeModel tree_model, Gtk.TreePath path);
}
[ReferenceType]
+ [CCode (cheader_filename = "gtk/gtk.h")]
public struct Type {
public pointer @class ();
}
public static delegate bool AccelGroupFindFunc (Gtk.AccelKey key, GLib.Closure closure, pointer data);
public static delegate void AccelMapForeach (pointer data, string accel_path, uint accel_key, Gdk.ModifierType accel_mods, bool changed);
public static delegate int AssistantPageFunc (int current_page, pointer data);
- public static delegate void BuilderConnectFunc (Gtk.Builder builder, GLib.Object object, string signal_name, string handler_name, GLib.Object connect_object, GLib.ConnectFlags @flags, pointer user_data);
+ public static delegate void BuilderConnectFunc (Gtk.Builder builder, GLib.Object object, string signal_name, string handler_name, GLib.Object connect_object, GLib.ConnectFlags flags, pointer user_data);
public static delegate void Callback (Gtk.Widget widget, pointer data);
public static delegate void CellLayoutDataFunc (Gtk.CellLayout cell_layout, Gtk.CellRenderer cell, Gtk.TreeModel tree_model, out Gtk.TreeIter iter, pointer data);
public static delegate void ClipboardClearFunc (Gtk.Clipboard clipboard, pointer user_data_or_owner);
public const string STOCK_ZOOM_FIT;
public const string STOCK_ZOOM_IN;
public const string STOCK_ZOOM_OUT;
+ public static void init (out string[] args);
+ public static void main ();
+ public static void main_quit ();
public static bool alternative_dialog_button_order (Gdk.Screen screen);
public static GLib.Type cell_type_get_type ();
public static weak string check_version (uint required_major, uint required_minor, uint required_micro);
public static void show_about_dialog (Gtk.Window parent, ...);
public static void text_layout_draw (pointer layout, Gtk.Widget widget, Gdk.Drawable drawable, Gdk.GC cursor_gc, int x_offset, int y_offset, int x, int y, int width, int height, GLib.List widgets);
}
-[CCode (cprefix = "Gtk", lower_case_cprefix = "gtk_", cheader_filename = "gtk/gtk.h")]
-namespace Gtk {
- public struct Allocation {
- public int x;
- public int y;
- public int width;
- public int height;
- }
- public static void init (out string[] args);
- public static void main ();
- public static void main_quit ();
-}
* Jürg Billeter <j@bitron.ch>
*/
-[CCode (cheader_filename = "gst/gst.h")]
namespace Gst {
public void init (ref string[] args);
}
* Jürg Billeter <j@bitron.ch>
*/
-[CCode (cheader_filename = "gtk/gtk.h")]
namespace Gtk {
public void init (out string[] args);
public void main ();
-[CCode (cprefix = "Pango", lower_case_cprefix = "pango_", cheader_filename = "pango/pango.h")]
+[CCode (cprefix = "Pango", lower_case_cprefix = "pango_")]
namespace Pango {
- [CCode (cprefix = "PANGO_ALIGN_")]
+ [CCode (cprefix = "PANGO_ALIGN_", cheader_filename = "pango/pango.h")]
public enum Alignment {
LEFT,
CENTER,
RIGHT,
}
- [CCode (cprefix = "PANGO_ATTR_")]
+ [CCode (cprefix = "PANGO_ATTR_", cheader_filename = "pango/pango.h")]
public enum AttrType {
INVALID,
LANGUAGE,
GRAVITY,
GRAVITY_HINT,
}
- [CCode (cprefix = "PANGO_COVERAGE_")]
+ [CCode (cprefix = "PANGO_COVERAGE_", cheader_filename = "pango/pango.h")]
public enum CoverageLevel {
NONE,
FALLBACK,
APPROXIMATE,
EXACT,
}
- [CCode (cprefix = "PANGO_DIRECTION_")]
+ [CCode (cprefix = "PANGO_DIRECTION_", cheader_filename = "pango/pango.h")]
public enum Direction {
LTR,
RTL,
WEAK_RTL,
NEUTRAL,
}
- [CCode (cprefix = "PANGO_ELLIPSIZE_")]
+ [CCode (cprefix = "PANGO_ELLIPSIZE_", cheader_filename = "pango/pango.h")]
public enum EllipsizeMode {
NONE,
START,
MIDDLE,
END,
}
- [CCode (cprefix = "PANGO_FONT_MASK_")]
+ [CCode (cprefix = "PANGO_FONT_MASK_", cheader_filename = "pango/pango.h")]
public enum FontMask {
FAMILY,
STYLE,
SIZE,
GRAVITY,
}
- [CCode (cprefix = "PANGO_GRAVITY_")]
+ [CCode (cprefix = "PANGO_GRAVITY_", cheader_filename = "pango/pango.h")]
public enum Gravity {
SOUTH,
EAST,
WEST,
AUTO,
}
- [CCode (cprefix = "PANGO_GRAVITY_HINT_")]
+ [CCode (cprefix = "PANGO_GRAVITY_HINT_", cheader_filename = "pango/pango.h")]
public enum GravityHint {
NATURAL,
STRONG,
LINE,
}
- [CCode (cprefix = "PANGO_RENDER_PART_")]
+ [CCode (cprefix = "PANGO_RENDER_PART_", cheader_filename = "pango/pango.h")]
public enum RenderPart {
FOREGROUND,
BACKGROUND,
UNDERLINE,
STRIKETHROUGH,
}
- [CCode (cprefix = "PANGO_SCRIPT_")]
+ [CCode (cprefix = "PANGO_SCRIPT_", cheader_filename = "pango/pango.h")]
public enum Script {
INVALID_CODE,
COMMON,
PHAGS_PA,
NKO,
}
- [CCode (cprefix = "PANGO_STRETCH_")]
+ [CCode (cprefix = "PANGO_STRETCH_", cheader_filename = "pango/pango.h")]
public enum Stretch {
ULTRA_CONDENSED,
EXTRA_CONDENSED,
EXTRA_EXPANDED,
ULTRA_EXPANDED,
}
- [CCode (cprefix = "PANGO_STYLE_")]
+ [CCode (cprefix = "PANGO_STYLE_", cheader_filename = "pango/pango.h")]
public enum Style {
NORMAL,
OBLIQUE,
ITALIC,
}
- [CCode (cprefix = "PANGO_TAB_")]
+ [CCode (cprefix = "PANGO_TAB_", cheader_filename = "pango/pango.h")]
public enum TabAlign {
LEFT,
}
- [CCode (cprefix = "PANGO_UNDERLINE_")]
+ [CCode (cprefix = "PANGO_UNDERLINE_", cheader_filename = "pango/pango.h")]
public enum Underline {
NONE,
SINGLE,
LOW,
ERROR,
}
- [CCode (cprefix = "PANGO_VARIANT_")]
+ [CCode (cprefix = "PANGO_VARIANT_", cheader_filename = "pango/pango.h")]
public enum Variant {
NORMAL,
SMALL_CAPS,
}
- [CCode (cprefix = "PANGO_WEIGHT_")]
+ [CCode (cprefix = "PANGO_WEIGHT_", cheader_filename = "pango/pango.h")]
public enum Weight {
ULTRALIGHT,
LIGHT,
ULTRABOLD,
HEAVY,
}
- [CCode (cprefix = "PANGO_WRAP_")]
+ [CCode (cprefix = "PANGO_WRAP_", cheader_filename = "pango/pango.h")]
public enum WrapMode {
WORD,
CHAR,
public void set_matrix (out Pango.Matrix matrix);
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct Analysis {
public weak Pango.EngineShape shape_engine;
public weak Pango.EngineLang lang_engine;
public weak Pango.Font font;
public uchar level;
public uchar gravity;
- public uchar @flags;
+ public uchar flags;
public uchar script;
public weak Pango.Language language;
public weak GLib.SList extra_attrs;
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct AttrClass {
public Pango.AttrType type;
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct AttrColor {
public weak Pango.Attribute attr;
public Pango.Color color;
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct AttrFloat {
public weak Pango.Attribute attr;
public double value;
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct AttrFontDesc {
public weak Pango.Attribute attr;
public weak Pango.FontDescription desc;
public AttrFontDesc (Pango.FontDescription desc);
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct AttrInt {
public weak Pango.Attribute attr;
public int value;
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct AttrIterator {
public weak Pango.AttrIterator copy ();
public void destroy ();
public void range (int start, int end);
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct AttrLanguage {
public weak Pango.Attribute attr;
public weak Pango.Language value;
public AttrLanguage (Pango.Language language);
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct AttrList {
public void change (Pango.Attribute attr);
public weak Pango.AttrList copy ();
public void unref ();
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct AttrShape {
public weak Pango.Attribute attr;
public Pango.Rectangle ink_rect;
public AttrShape.with_data (out Pango.Rectangle ink_rect, out Pango.Rectangle logical_rect, pointer data, Pango.AttrDataCopyFunc copy_func, GLib.DestroyNotify destroy_func);
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct AttrSize {
public weak Pango.Attribute attr;
public int size;
public AttrSize (int size);
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct AttrString {
public weak Pango.Attribute attr;
public weak string value;
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct Attribute {
public pointer klass;
public uint start_index;
public void destroy ();
public bool equal (Pango.Attribute attr2);
}
+ [CCode (cheader_filename = "pango/pango.h")]
public struct Color {
public ushort red;
public ushort green;
public weak string to_string ();
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct Coverage {
public weak Pango.Coverage copy ();
[NoArrayLength]
public void unref ();
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct EngineLang {
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct EngineShape {
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct FontDescription {
public bool better_match (Pango.FontDescription old_match, Pango.FontDescription new_match);
public weak Pango.FontDescription copy ();
public void unset_fields (Pango.FontMask to_unset);
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct FontMetrics {
public int get_approximate_char_width ();
public int get_approximate_digit_width ();
public void unref ();
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct GlyphGeometry {
public int width;
public int x_offset;
public int y_offset;
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct GlyphInfo {
public uint glyph;
public weak Pango.GlyphGeometry geometry;
public weak Pango.GlyphVisAttr attr;
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct GlyphItem {
public weak Pango.Item item;
public weak Pango.GlyphString glyphs;
public weak Pango.GlyphItem split (string text, int split_index);
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct GlyphString {
public int num_glyphs;
public weak Pango.GlyphInfo glyphs;
public void x_to_index (string text, int length, Pango.Analysis analysis, int x_pos, int index_, int trailing);
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct GlyphVisAttr {
public uint is_cluster_start;
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct Item {
public int offset;
public int length;
public weak Pango.Item split (int split_index, int split_offset);
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct Language {
public static weak Pango.Language from_string (string language);
public static weak Pango.Language get_default ();
public bool matches (string range_list);
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct LayoutIter {
public bool at_last_line ();
public void free ();
public bool next_run ();
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct LayoutLine {
public weak Pango.Layout layout;
public int start_index;
public bool x_to_index (int x_pos, int index_, int trailing);
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct LayoutRun {
public weak Pango.Item item;
public weak Pango.GlyphString glyphs;
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct LogAttr {
public uint is_line_break;
public uint is_mandatory_break;
public uint backspace_deletes_character;
public uint is_expandable_space;
}
+ [CCode (cheader_filename = "pango/pango.h")]
public struct Matrix {
public double xx;
public double xy;
[InstanceByReference]
public void translate (double tx, double ty);
}
+ [CCode (cheader_filename = "pango/pango.h")]
public struct Rectangle {
public int x;
public int y;
public int height;
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct ScriptIter {
public void free ();
public void get_range (string start, string end, Pango.Script script);
public bool next ();
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct TabArray {
public weak Pango.TabArray copy ();
public void free ();
public void set_tab (int tab_index, Pango.TabAlign alignment, int location);
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct Win32FontCache {
public void free ();
public pointer load (pointer logfont);
public void unload (pointer hfont);
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct Attr {
public static weak Pango.Attribute background_new (ushort red, ushort green, ushort blue);
public static weak Pango.Attribute fallback_new (bool enable_fallback);
public static weak Pango.Attribute weight_new (Pango.Weight weight);
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct Cairo {
public static pointer context_get_font_options (Pango.Context context);
public static double context_get_resolution (Pango.Context context);
public static void update_layout (Cairo.Context cr, Pango.Layout layout);
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct Units {
public static int from_double (double d);
public static double to_double (int i);
}
[ReferenceType]
+ [CCode (cheader_filename = "pango/pango.h")]
public struct Version {
public static weak string check (int required_major, int required_minor, int required_micro);
public static weak string string ();
-[CCode (cprefix = "Vte", lower_case_cprefix = "vte_", cheader_filename = "vte/vte.h")]
+[CCode (cprefix = "Vte", lower_case_cprefix = "vte_")]
namespace Vte {
- [CCode (cprefix = "VTE_ANTI_ALIAS_")]
+ [CCode (cprefix = "VTE_ANTI_ALIAS_", cheader_filename = "vte/vte.h")]
public enum TerminalAntiAlias {
USE_DEFAULT,
FORCE_ENABLE,
FORCE_DISABLE,
}
- [CCode (cprefix = "VTE_ERASE_")]
+ [CCode (cprefix = "VTE_ERASE_", cheader_filename = "vte/vte.h")]
public enum TerminalEraseBinding {
AUTO,
ASCII_BACKSPACE,
public TerminalAccessibleFactory ();
}
[ReferenceType]
+ [CCode (cheader_filename = "vte/vte.h")]
public struct CharAttributes {
public long row;
public long column;
public class Vala.GIdlParser : CodeVisitor {
private CodeContext context;
+ private SourceFile current_source_file;
+
private SourceReference current_source_reference;
private DataType current_data_type;
private void parse_file (SourceFile! source_file) {
string metadata_filename = "%s.metadata".printf (source_file.filename.ndup (source_file.filename.size () - ".gidl".size ()));
-
+
+ current_source_file = source_file;
+
codenode_attributes_map = new HashTable.full (str_hash, str_equal, g_free, g_free);
if (FileUtils.test (metadata_filename, FileTest.EXISTS)) {
foreach (IdlModule module in modules) {
var ns = parse_module (module);
- context.add_namespace (ns);
+ if (ns != null) {
+ context.root.add_namespace (ns);
+ }
}
} catch (MarkupError e) {
stdout.printf ("error parsing GIDL file: %s\n", e.message);
}
private Namespace parse_module (IdlModule! module) {
- var ns = new Namespace (module.name, current_source_reference);
+ Symbol sym = context.root.scope.lookup (module.name);
+ Namespace ns;
+ if (sym is Namespace) {
+ ns = (Namespace) sym;
+ ns.pkg = false;
+ } else {
+ ns = new Namespace (module.name, current_source_reference);
+ }
var attributes = get_attributes (ns.name);
if (attributes != null) {
}
cb.name = fix_type_name (cb.name, module);
ns.add_callback (cb);
+ current_source_file.add_node (cb);
} else if (node.type == IdlNodeTypeId.STRUCT) {
var st = parse_struct ((IdlNodeStruct) node);
if (st == null) {
}
st.name = fix_type_name (st.name, module);
ns.add_struct (st);
+ current_source_file.add_node (st);
} else if (node.type == IdlNodeTypeId.BOXED) {
var st = parse_boxed ((IdlNodeBoxed) node);
st.name = fix_type_name (st.name, module);
ns.add_struct (st);
st.set_type_id (st.get_upper_case_cname ("TYPE_"));
+ current_source_file.add_node (st);
} else if (node.type == IdlNodeTypeId.ENUM) {
var en = parse_enum ((IdlNodeEnum) node);
en.name = fix_type_name (en.name, module);
ns.add_enum (en);
+ current_source_file.add_node (en);
} else if (node.type == IdlNodeTypeId.OBJECT) {
var cl = parse_object ((IdlNodeInterface) node);
cl.name = fix_type_name (cl.name, module);
ns.add_class (cl);
+ current_source_file.add_node (cl);
} else if (node.type == IdlNodeTypeId.INTERFACE) {
var iface = parse_interface ((IdlNodeInterface) node);
iface.name = fix_type_name (iface.name, module);
ns.add_interface (iface);
+ current_source_file.add_node (iface);
} else if (node.type == IdlNodeTypeId.CONSTANT) {
var c = parse_constant ((IdlNodeConstant) node);
c.name = fix_const_name (c.name, module);
ns.add_constant (c);
+ current_source_file.add_node (c);
} else if (node.type == IdlNodeTypeId.FUNCTION) {
var m = parse_function ((IdlNodeFunction) node);
if (m != null) {
m.instance = false;
ns.add_method (m);
+ current_source_file.add_node (m);
}
}
}
+ if (sym is Namespace) {
+ return null;
+ }
return ns;
}
return quit ();
}
- var builder = new SymbolBuilder ();
- builder.build (context);
-
- if (Report.get_errors () > 0) {
- return quit ();
- }
-
var attributeprocessor = new AttributeProcessor ();
attributeprocessor.process (context);