From 2d4a4a264677b42710914907f63e1624e25e560f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Billeter?= Date: Tue, 31 Mar 2009 00:31:07 +0200 Subject: Rework header file generation Generate single C header file for public API, do not use header files for internal API. Fixes bug 471244, bug 571037, bug 572536, and bug 575629. --- gobject/valaccodememberaccessmodule.vala | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'gobject/valaccodememberaccessmodule.vala') diff --git a/gobject/valaccodememberaccessmodule.vala b/gobject/valaccodememberaccessmodule.vala index d2731e8af..8b618acc5 100644 --- a/gobject/valaccodememberaccessmodule.vala +++ b/gobject/valaccodememberaccessmodule.vala @@ -45,7 +45,19 @@ internal class Vala.CCodeMemberAccessModule : CCodeControlFlowModule { if (expr.symbol_reference is Method) { var m = (Method) expr.symbol_reference; - + + if (!(m is DynamicMethod || m is ArrayMoveMethod || m is ArrayResizeMethod)) { + generate_method_declaration (m, source_declarations); + + if (!m.external && m.external_package) { + // internal VAPI methods + // only add them once per source file + if (add_generated_external_symbol (m)) { + visit_method (m); + } + } + } + if (expr.inner is BaseAccess) { if (m.base_method != null) { var base_class = (Class) m.base_method.parent_symbol; @@ -103,6 +115,9 @@ internal class Vala.CCodeMemberAccessModule : CCodeControlFlowModule { if (is_gtypeinstance && f.access == SymbolAccessibility.PRIVATE) { inst = new CCodeMemberAccess.pointer (pub_inst, "priv"); } else { + if (cl != null) { + generate_class_struct_declaration (cl, source_declarations); + } inst = pub_inst; } if (instance_target_type.data_type.is_reference_type () || (expr.inner != null && expr.inner.value_type is PointerType)) { @@ -149,6 +164,8 @@ internal class Vala.CCodeMemberAccessModule : CCodeControlFlowModule { } else if (expr.symbol_reference is Constant) { var c = (Constant) expr.symbol_reference; + generate_constant_declaration (c, source_declarations); + string fn = c.get_full_name (); if (fn == "GLib.Log.FILE") { string s = Path.get_basename (expr.source_reference.file.filename); @@ -168,6 +185,18 @@ internal class Vala.CCodeMemberAccessModule : CCodeControlFlowModule { } else if (expr.symbol_reference is Property) { var prop = (Property) expr.symbol_reference; + if (!(prop is DynamicProperty)) { + generate_property_accessor_declaration (prop.get_accessor, source_declarations); + + if (!prop.external && prop.external_package) { + // internal VAPI properties + // only add them once per source file + if (add_generated_external_symbol (prop)) { + visit_property (prop); + } + } + } + if (expr.inner is BaseAccess) { if (prop.base_property != null) { var base_class = (Class) prop.base_property.parent_symbol; -- cgit v1.2.1