valadoc r9 - in trunk/src: doclets/devhelp/doclet doclets/devhelp/linkhelper doclets/html/doclet doclets/html/linkhelper doclets/valadoc.org/doclet doclets/valadoc.org/linkhelper libvaladoc



Author: flobrosch
Date: Mon Nov  3 00:25:13 2008
New Revision: 9
URL: http://svn.gnome.org/viewvc/valadoc?rev=9&view=rev

Log:

libvaladoc:
 * package view




Modified:
   trunk/src/doclets/devhelp/doclet/template.vala
   trunk/src/doclets/devhelp/linkhelper/helper.vala
   trunk/src/doclets/html/doclet/template.vala
   trunk/src/doclets/html/linkhelper/helper.vala
   trunk/src/doclets/valadoc.org/doclet/template.vala
   trunk/src/doclets/valadoc.org/linkhelper/helper.vala
   trunk/src/libvaladoc/doclet.vala
   trunk/src/libvaladoc/doctree.vala
   trunk/src/libvaladoc/langlet.vala

Modified: trunk/src/doclets/devhelp/doclet/template.vala
==============================================================================
--- trunk/src/doclets/devhelp/doclet/template.vala	(original)
+++ trunk/src/doclets/devhelp/doclet/template.vala	Mon Nov  3 00:25:13 2008
@@ -462,7 +462,7 @@
 	public override void write_namespace ( Valadoc.Namespace ns, void* ptr ) {
 	}
 
-	public override void write_file ( Valadoc.File file, void* ptr ) {
+	public override void write_file ( Valadoc.Package file, void* ptr ) {
 	}
 }
 
@@ -542,42 +542,6 @@
 		""
 	};
 
-	private Xml.Node* find_child_node ( Xml.Node* element, string name ) {
-		for ( Xml.Node* pos = element->children; pos != null ; pos = pos->next ) {
-			if ( name == pos->get_prop ( "name" ) ) {
-				return pos;
-			}
-		}
-		return null;
-	}
-
-	private Xml.Node* get_node ( string full_name ) {
-		Xml.Node* cur = this.chapters;
-		string[] path = full_name.split ( "." );
-
-		for ( int i = 0; path[i] != null ; i++ ) {
-			cur = this.find_child_node ( cur, path[i] );
-			if ( cur == null ) {
-				return null;
-			}
-		}
-
-		return null;
-	}
-
-	public void reset ( ) {
-		this.current = this.chapters;
-	}
-
-	public bool jump_to_chapter ( string full_name ) {
-		Xml.Node* node = this.get_node ( full_name );
-		if ( node != null ) {
-			this.current = node;
-			return true;
-		}
-		return false;
-	}
-
 	public void add_chapter_start ( string name, string link ) {
 		this.current = this.current->new_child ( null, "sub" );
 		this.current->new_prop ( "name", name );
@@ -655,10 +619,6 @@
 		return this.settings.get_real_path ( ) + "/" + this.package_dir_name + "/" + "img/" + element.full_name () + ".png";
 	}
 
-	~HtmlDoclet ( ) {
-		this.devhelp.save_file ( this.settings.get_real_path () + "/" + vala_file_package_name + "/" + vala_file_package_name + ".devhelp2" );
-	}
-
 	public Valadoc.Settings settings {
 		construct set;
 		protected get;
@@ -696,48 +656,25 @@
 	private bool visited_non_package = false;
 
 
-	public override void visit_file ( File file ) {
+	public override void visit_package ( Package file ) {
 		string pkg_name = get_package_name ( file.name );
 		string path = this.settings.get_real_path () + pkg_name + "/";
 		this.package_dir_name = pkg_name;
 
-		if ( file.is_package == true ) {
-			var rt = DirUtils.create ( path, 0777 );
-			rt = DirUtils.create ( path + "img/", 0777 );
-			copy_directory ( Config.doclet_path + "deps/", path );
-
-			DevhelpFormat tmp = this.devhelp;
-
-			this.devhelp = new DevhelpFormat ( pkg_name, "" );
+		var rt = DirUtils.create ( path, 0777 );
+		rt = DirUtils.create ( path + "img/", 0777 );
+		copy_directory ( Config.doclet_path + "deps/", path );
 
-			GLib.FileStream ifile = GLib.FileStream.open ( path + "index.htm", "w" );
-			this.write_file_header_template ( ifile, pkg_name );
-			this.write_file_footer ( ifile );
-			ifile = null;
-
-			file.visit_namespaces ( this );
-
-			this.devhelp.save_file ( path + pkg_name + ".devhelp2" );
-			this.devhelp = tmp;
-		}
-		else {
-			if ( !visited_non_package ) {
-				this.vala_file_package_name = pkg_name;
-				var rt = DirUtils.create ( path, 0777 );
-				rt = DirUtils.create ( path + "img/", 0777 );
-				copy_directory ( Config.doclet_path + "deps/", path );
-				this.devhelp.reset ( );
-			}
+		this.devhelp = new DevhelpFormat ( pkg_name, "" );
 
-			GLib.FileStream ifile = GLib.FileStream.open ( path + "index.htm", "w" );
-			this.write_file_header_template ( ifile, pkg_name );
-			this.write_file_footer ( ifile );
-			ifile = null;
+		GLib.FileStream ifile = GLib.FileStream.open ( path + "index.htm", "w" );
+		this.write_file_header_template ( ifile, pkg_name );
+		this.write_file_footer ( ifile );
+		ifile = null;
 
-			file.visit_namespaces ( this );
+		file.visit_namespaces ( this );
 
-			this.visited_non_package = true;
-		}
+		this.devhelp.save_file ( path + pkg_name + ".devhelp2" );
 	}
 
 	public void write_namespace_content ( GLib.FileStream file, Namespace ns ) {
@@ -751,25 +688,15 @@
 		string rpath = this.get_real_path ( ns );
 		string path = this.get_path ( ns );
 
-		bool file_exists = FileUtils.test ( rpath, FileTest.EXISTS);
-		if ( !file_exists ) {
-			GLib.FileStream file = GLib.FileStream.open ( rpath, "w" );
-			this.write_file_header_template ( file, ns.full_name() );
-			this.write_namespace_content ( file, ns );
-			this.write_file_footer ( file );
-			file = null;
-
-			if ( ns.name != null ) {
-				this.devhelp.add_keyword ( KeywordType.NAMESPACE, ns.name, path );
-				this.devhelp.add_chapter_start ( ns.name, path );
-			}
-		}
-		else {
-			bool available = this.devhelp.jump_to_chapter ( ns.full_name () );
-			if ( available == false ) {
-				this.devhelp.add_keyword ( KeywordType.NAMESPACE, ns.name, path );
-				this.devhelp.add_chapter_start ( ns.name, path );
-			}
+		GLib.FileStream file = GLib.FileStream.open ( rpath, "w" );
+		this.write_file_header_template ( file, ns.full_name() );
+		this.write_namespace_content ( file, ns );
+		this.write_file_footer ( file );
+		file = null;
+
+		if ( ns.name != null ) {
+			this.devhelp.add_keyword ( KeywordType.NAMESPACE, ns.name, path );
+			this.devhelp.add_chapter_start ( ns.name, path );
 		}
 
 		// file:

Modified: trunk/src/doclets/devhelp/linkhelper/helper.vala
==============================================================================
--- trunk/src/doclets/devhelp/linkhelper/helper.vala	(original)
+++ trunk/src/doclets/devhelp/linkhelper/helper.vala	Mon Nov  3 00:25:13 2008
@@ -119,7 +119,7 @@
 		Valadoc.Basic pos = tag;
 
 		while ( pos != null ) {
-			if ( pos is Valadoc.File )
+			if ( pos is Valadoc.Package )
 				return pos.name;
 
 			pos = pos.parent;

Modified: trunk/src/doclets/html/doclet/template.vala
==============================================================================
--- trunk/src/doclets/html/doclet/template.vala	(original)
+++ trunk/src/doclets/html/doclet/template.vala	Mon Nov  3 00:25:13 2008
@@ -493,106 +493,7 @@
 	public override void write_namespace ( Valadoc.Namespace ns, void* ptr ) {
 	}
 
-	public override void write_file ( Valadoc.File file, void* ptr ) {
-	}
-}
-
-
-
-
-private class NamespaceBundle : Object {
-	public Namespace creation_namespace { construct set; get; }
-	public NamespaceBundle? parent { construct set; get; }
-	public string? name { construct set; get; }
-	public string path { construct set; get; }
-
-	public Gee.ArrayList<NamespaceBundle> subnamespaces = new Gee.ArrayList<NamespaceBundle> ();
-
-	public string full_name () {
-		return this.creation_namespace.full_name ();
-	}
-
-	public NamespaceBundle ( string path, string? name, Namespace creation_namespace, NamespaceBundle? parent = null ) {
-		this.creation_namespace = creation_namespace;
-		this.parent = parent;
-		this.name = name;
-		this.path = path;
-	}
-
-	private NamespaceBundle get_namespace_bundle ( Namespace ns ) {
-		foreach ( NamespaceBundle bundle in this.subnamespaces ) {
-			if ( this.name == ns.name ) {
-				return bundle;
-			}
-		}
-
-		NamespaceBundle nsbundle = new NamespaceBundle ( this.path + ns.name + "/", ns.name, ns, this );
-		this.subnamespaces.add ( nsbundle );
-		return nsbundle;
-	}
-
-	public Gee.ArrayList<ErrorDomain> errordomains = new Gee.ArrayList<ErrorDomain> ();
-	public Gee.ArrayList<Interface> interfaces = new Gee.ArrayList<Interface> ();
-	public Gee.ArrayList<Struct> structs = new Gee.ArrayList<Struct> ();
-	public Gee.ArrayList<Class> classes = new Gee.ArrayList<Class> ();
-	public Gee.ArrayList<Enum> enums = new Gee.ArrayList<Enum> ();
-
-	public Gee.ArrayList<Constant> constants = new Gee.ArrayList<Constant> ();
-	public Gee.ArrayList<Delegate> delegates = new Gee.ArrayList<Delegate> ();
-	public Gee.ArrayList<Method> methods = new Gee.ArrayList<Method> ();
-	public Gee.ArrayList<Field> fields = new Gee.ArrayList<Field> ();
-
-	public void merge_namespace ( Namespace ns ) {
-		Gee.Collection<Namespace> subnamespaces = ns.get_namespace_list ();
-		foreach ( Namespace subns in subnamespaces ) {
-			NamespaceBundle nsbundle = this.get_namespace_bundle ( subns );
-			nsbundle.merge_namespace ( subns );
-		}
-
-		Gee.Collection<ErrorDomain> errordomains = ns.get_error_domain_list ();
-		foreach ( ErrorDomain errdom in errordomains ) {
-			this.errordomains.add ( errdom );
-		}
-
-		Gee.Collection<Interface> interfaces = ns.get_interface_list ();
-		foreach ( Interface iface in interfaces ) {
-			this.interfaces.add ( iface );
-		}
-
-		Gee.Collection<Struct> structs = ns.get_struct_list ();
-		foreach ( Struct stru in structs ) {
-			this.structs.add ( stru );
-		}
-
-		Gee.Collection<Class> classes = ns.get_class_list ();
-		foreach ( Class cl in classes ) {
-			this.classes.add ( cl );
-		}
-
-		Gee.Collection<Enum> enums = ns.get_enum_list ();
-		foreach ( Enum en in enums ) {
-			this.enums.add ( en );
-		}
-
-		Gee.Collection<Constant> constants = ns.get_constant_list ();
-		foreach ( Constant c in constants ) {
-			this.constants.add ( c );
-		}
-
-		Gee.Collection<Delegate> delegates = ns.get_delegate_list ();
-		foreach ( Delegate d in delegates ) {
-			this.delegates.add ( d );
-		}
-
-		Gee.Collection<Method> methods = ns.get_method_list ();
-		foreach ( Method m in methods ) {
-			this.methods.add ( m );
-		}
-
-		Gee.Collection<Field> fields = ns.get_field_list ();
-		foreach ( Field f in fields ) {
-			this.fields.add ( f );
-		}
+	public override void write_file ( Valadoc.Package file, void* ptr ) {
 	}
 }
 
@@ -627,7 +528,7 @@
 			else
 				name = element.name;
 		}
-		else if ( element is File ) {
+		else if ( element is Package ) {
 			string path = this.get_file_name ( element );
 			name = this.get_package_name ( path );
 		}
@@ -662,7 +563,7 @@
 			style = css_navi_class;
 		else if ( element is Interface )
 			style = css_navi_iface;
-		else if ( element is File ) {
+		else if ( element is Package ) {
 			name = this.get_package_name ( element.name );
 			style = css_navi_package;
 		}
@@ -721,7 +622,7 @@
 		}
 	}
 
-	private void write_navi_file ( GLib.FileStream file, File efile ) {
+	private void write_navi_file ( GLib.FileStream file, Package efile ) {
 		Gee.ArrayList<Namespace> ns_list = new Gee.ArrayList<Namespace> ();
 		this.fetch_subnamespace_names (efile, ns_list );
 
@@ -1132,7 +1033,7 @@
 		GLib.StringBuilder str = new GLib.StringBuilder ( "" );
 
 		for ( var pos = element; pos != null ; pos = pos.parent ) {
-			if ( pos is File )
+			if ( pos is Package )
 				break;
 
 			str.prepend_unichar ( '/' );
@@ -1181,7 +1082,7 @@
 		file.printf ( "<img cass=\"%s\" src=\"%s\"/>\n", css_diagram, imgpath );
 	}
 
-	private void write_file_content ( GLib.FileStream file, File f ) {
+	private void write_file_content ( GLib.FileStream file, Package f ) {
 		file.printf ( "\t\t\t<div class=\"%s\">\n", css_style_content );
 		file.printf ( "\t\t\t\t<h1 class=\"%s\">%s:</h1>\n", css_title, this.package_name );
 		file.printf ( "\t\t\t\t<hr class=\"%s\" />\n", css_headline_hr );
@@ -1189,26 +1090,23 @@
 		file.puts ( "\t\t\t</div>\n" );
 	}
 
-	private Gee.ArrayList<File> files = new Gee.ArrayList<File> ();
-
-	public override void visit_file ( File file ) {
+	public override void visit_package ( Package file ) {
 		this.package_name = this.get_package_name ( file.name );
-		this.is_vapi = file.name.has_suffix (".vapi");
-		this.files.add ( file );
+
+		this.is_vapi = file.is_external_package;
+		if ( this.is_vapi )
+			this.files.add ( file );
 
 		string new_path = this.settings.path + this.package_name + "/";
 		bool dir_exists = FileUtils.test ( new_path, FileTest.EXISTS);
 
-		if ( !dir_exists ) {
-			var rt = DirUtils.create ( new_path, 0777 );
-
-			GLib.FileStream sfile = GLib.FileStream.open ( new_path + "index.html", "w" );
-			this.write_file_header ( sfile );
-			this.write_navi_file ( sfile, file );
-			this.write_file_content ( sfile, file );
-			this.write_file_footer ( sfile );
-			sfile = null;
-		}
+		var rt = DirUtils.create ( new_path, 0777 );
+		GLib.FileStream sfile = GLib.FileStream.open ( new_path + "index.html", "w" );
+		this.write_file_header ( sfile );
+		this.write_navi_file ( sfile, file );
+		this.write_file_content ( sfile, file );
+		this.write_file_footer ( sfile );
+		sfile = null;
 
 		this.current_path = new_path;
 		file.visit_namespaces ( this );
@@ -1216,146 +1114,6 @@
 	}
 
 
-//	private Gee.ArrayList<Namespace> namespaces = new Gee.ArrayList<Namespace> ();
-//  globale Funktionen
-//  globale Konstante
-//  globale Delegates
-//  globale Felder
-
-	private Gee.ArrayList<NamespaceBundle> namespaces = new Gee.ArrayList<NamespaceBundle> ();
-
-	private void add_namespace_bundle ( Namespace ns ) {
-		if ( ns.parent is Namespace )
-			return ;
-
-		foreach ( NamespaceBundle bundle in this.namespaces ) {
-			if ( bundle.name == ns.name ) {
-				bundle.merge_namespace ( ns );
-				return ;
-			}
-		}
-
-		NamespaceBundle bundle = new NamespaceBundle ( this.current_path, ns.name, ns );
-		this.namespaces.add ( bundle );
-		bundle.merge_namespace ( ns );
-	}
-
-	private void write_navi_namespace_bundle_path_navigation ( NamespaceBundle nsbundle, GLib.FileStream navi, Basic mself ) {
-		this.directory_level++;
-
-		string top_link = this.get_top_link ( (mself == null)? nsbundle.creation_namespace : mself );
-
-		Gee.ArrayList<NamespaceBundle> parents = new Gee.ArrayList<NamespaceBundle> ();
-		for ( NamespaceBundle nsb = nsbundle.parent; nsb != null ; nsb = nsb.parent ) {
-			parents.insert ( 0, nsb );
-		}
-
-		navi.printf ( "\t\t\t<div class=\"%s\">\n", css_style_navigation );
-		this.write_top_element ( navi, mself );
-
-		navi.printf ( "<ul class=\"%s\">\n", css_navi );
-		this.write_navi_entry_html_template_with_link ( navi, css_navi_package, top_link + this.package_name + "/index.html", this.package_name );
-		navi.puts ( "</ul>\n" );
-		navi.printf ( "<hr class=\"%s\">\n", css_navi_hr );
-
-		int indent = parents.size;
-
-		foreach ( NamespaceBundle nsb in parents ) {
-			string ns_link = "";
-
-			for ( int i = 0; indent > i ; i++ )
-				ns_link += "../";
-
-			ns_link += "index.html";
-
-			navi.printf ( "<ul class=\"%s\">\n", css_navi );
-			this.write_navi_entry_html_template_with_link ( navi, css_navi_namespace, ns_link, (nsb.name == null)? "Global Namespace" : nsb.name );
-			navi.puts ( "</ul>\n" );
-			navi.printf ( "\n<hr class=\"%s\">\n", css_navi_hr );
-		}
-
-		navi.printf ( "<ul class=\"%s\">\n", css_navi );
-		if ( mself.name == nsbundle.name ) {
-			this.write_navi_entry_html_template ( navi, css_navi_namespace, (nsbundle.name == null)? "Global Namespace" : nsbundle.name );
-		}
-		else {
-			this.write_navi_entry_html_template_with_link ( navi, css_navi_namespace, "../index.html", (nsbundle.name == null)? "Global Namespace" : nsbundle.name );
-		}
-		navi.puts ( "</ul>\n" );
-		navi.printf ( "\n<hr class=\"%s\">\n", css_navi_hr );
-
-		navi.printf ( "<ul class=\"%s\">\n", css_navi );
-		foreach ( NamespaceBundle nsb in nsbundle.subnamespaces ) {
-			this.write_navi_entry_html_template_with_link ( navi, css_navi_namespace, nsb.name + "/index.html", (nsb.name == null)? "Global Namespace" : nsb.name );
-		}
-
-		this.write_navi_child_classes_without_childs_collection ( navi, nsbundle.classes, mself );
-		this.write_navi_child_interfaces_without_childs_collection ( navi, nsbundle.interfaces, mself );
-		this.write_navi_child_structs_without_childs_collection ( navi, nsbundle.structs, mself );
-		this.write_navi_child_enums_without_childs_collection ( navi, nsbundle.enums, mself );
-		this.write_navi_child_error_domains_without_childs_collection ( navi, nsbundle.errordomains, mself );
-		this.write_navi_child_delegates_collection ( navi, nsbundle.delegates, mself );
-		this.write_navi_child_methods_collection ( navi, nsbundle.methods, mself );
-		this.write_navi_child_fields_collection ( navi, nsbundle.fields, mself );
-		this.write_navi_child_constants_collection ( navi, nsbundle.constants, mself );
-
-		navi.puts ( "</ul>\n" );
-		navi.puts ( "\t\t\t</div>\n" );
-
-		this.directory_level--;
-	}
-
-	private void write_navi_namespace_bundle ( NamespaceBundle nsbundle, Basic mself ) {
-		this.directory_level++;
-
-		foreach ( NamespaceBundle subnsbundle in nsbundle.subnamespaces ) {
-			this.write_navi_namespace_bundle ( subnsbundle, mself );
-		}
-
-		this.directory_level++;
-		foreach ( Delegate del in nsbundle.delegates ) {
-			GLib.FileStream file = GLib.FileStream.open ( nsbundle.path + del.name + "/index.html", "w" );
-			this.write_file_header ( file );
-			this.write_navi_namespace_bundle_path_navigation ( nsbundle, file, del );
-			this.write_delegate_content ( file, del );
-			this.write_file_footer ( file );
-		}
-		foreach ( Method m in nsbundle.methods ) {
-			GLib.FileStream file = GLib.FileStream.open ( nsbundle.path + m.name + "/index.html", "w" );
-			this.write_file_header ( file );
-			this.write_navi_namespace_bundle_path_navigation ( nsbundle, file, m );
-			this.write_method_content ( file, m, (MethodHandler)m.parent );
-			this.write_file_footer ( file );
-		}
-		foreach ( Field f in nsbundle.fields ) {
-			GLib.FileStream file = GLib.FileStream.open ( nsbundle.path + f.name + "/index.html", "w" );
-			this.write_file_header ( file );
-			this.write_navi_namespace_bundle_path_navigation ( nsbundle, file, f );
-			this.write_field_content ( file, f, (FieldHandler)f.parent );
-			this.write_file_footer ( file );
-		}
-		foreach ( Constant c in nsbundle.constants ) {
-			GLib.FileStream file = GLib.FileStream.open ( nsbundle.path + c.name + "/index.html", "w" );
-			this.write_file_header ( file );
-			this.write_navi_namespace_bundle_path_navigation ( nsbundle, file, c );
-			this.write_constant_content ( file, c, (ConstantHandler)c.parent );
-			this.write_file_footer ( file );
-		}
-		this.directory_level--;
-
-		GLib.FileStream file = GLib.FileStream.open ( nsbundle.path + "index.html", "w" );
-		this.write_file_header ( file );
-		this.write_navi_namespace_bundle_path_navigation ( nsbundle, file, (mself == null)? nsbundle.creation_namespace : mself );
-		file.printf ( "\t\t\t<div class=\"%s\">\n", css_style_content );
-		file.printf ( "<h1 class=\"%s\">%s:</h1>\n", css_title, (nsbundle.name == null)? "Global Namespace" : nsbundle.full_name () );
-		file.printf ( "<hr class=\"%s\" />\n", css_hr );
-		file.printf ( "<h2 class=\"%s\">Description:</h2>\n", css_title );
-		file.puts ( "\t\t\t</div>\n" );
-		this.write_file_footer ( file );
-
-		this.directory_level--;
-	}
-
 	private bool is_depency ( string dep ) {
 		foreach ( string file in this.settings.files ) {
 			if ( dep == file )
@@ -1364,32 +1122,32 @@
 		return true;
 	}
 
+	private Gee.ArrayList<Namespace> source_namespaces = new Gee.ArrayList<Namespace> ();
+	private Gee.ArrayList<Package> files = new Gee.ArrayList<Package> ();
+
+
 	~HtmlDoclet () {
 		this.directory_level = 1;
-
 		copy_directory ( Config.doclet_path + "deps/", this.settings.path );
 
-		foreach ( NamespaceBundle nsbundle in this.namespaces ) {
-			this.write_navi_namespace_bundle ( nsbundle, null );
-		}
-
 		GLib.FileStream sfile = GLib.FileStream.open ( this.settings.path + "index.html", "w" );
 		string title = ( this.settings.pkg_name == null )? "" : this.settings.pkg_name;
 		this.write_file_header_template ( sfile, title, 0 );
 
-		sfile.printf ( "<h2 class=\"%s\">Namespaces:</h2>\n", css_title );
-		sfile.printf ( "<ul class=\"%s\">\n", css_inline_navigation );
-		foreach ( NamespaceBundle nsb in this.namespaces ) {
-			string dir = (nsb.name == null)? "0" : nsb.name;
-			this.write_navi_entry_html_template_with_link ( sfile, css_inline_navigation_namespace,  this.package_name + "/" + dir + "/index.html", (nsb.name == null)? "Global Namespace" : nsb.name );
+		if ( this.source_namespaces.size > 0 ) {
+			sfile.printf ( "<h2 class=\"%s\">Namespaces:</h2>\n", css_title );
+			sfile.printf ( "<ul class=\"%s\">\n", css_inline_navigation );
+			foreach ( Namespace ns in this.source_namespaces ) {
+				string dir = (ns.name == null)? "0" : ns.name;
+				this.write_navi_entry_html_template_with_link ( sfile, css_inline_navigation_namespace, this.get_link(ns, null), (ns.name == null)? "Global Namespace" : ns.full_name () );
+			}		
+			sfile.puts ( "</ul>\n\n" );
 		}
-		sfile.puts ( "</ul>\n\n" );
-
 
 		sfile.printf ( "<h2 class=\"%s\">Depencies:</h2>\n", css_title );
 		sfile.printf ( "<ul class=\"%s\">\n", css_inline_navigation );
 
-		foreach ( File file in this.files ) {
+		foreach ( Package file in this.files ) {
 			if ( !this.is_depency ( file.name ) )
 				continue;
 
@@ -1400,9 +1158,7 @@
 		}
 
 		sfile.puts ( "</ul>\n" );
-
 		this.write_file_footer ( sfile );
-		sfile = null;
 	}
 
 	public void write_namespace_content ( GLib.FileStream file, Namespace ns ) {
@@ -1870,49 +1626,41 @@
 		string path = this.current_path + constant.name + "/";
 
 		var rt = DirUtils.create ( path, 0777 );
-
-		if ( this.is_vapi || constant.parent is Namespace == false ) {
-			this.directory_level++;
-			GLib.FileStream file = GLib.FileStream.open ( path + "index.html", "w");
-			this.write_file_header ( file );
-			this.write_navi_constant ( file, constant );
-			this.write_constant_content ( file, constant, parent );
-			this.write_file_footer ( file );
-			this.directory_level--;
-			file = null;
-		}
+		this.directory_level++;
+		GLib.FileStream file = GLib.FileStream.open ( path + "index.html", "w");
+		this.write_file_header ( file );
+		this.write_navi_constant ( file, constant );
+		this.write_constant_content ( file, constant, parent );
+		this.write_file_footer ( file );
+		this.directory_level--;
+		file = null;
 	}
 
 	public override void visit_field ( Field field, FieldHandler parent ) {
 		string path = this.current_path + field.name + "/";
 		var rt = DirUtils.create ( path, 0777 );
-
-		if ( this.is_vapi || field.parent is Namespace == false ) {
-			this.directory_level++;
-			GLib.FileStream file = GLib.FileStream.open ( path + "index.html", "w");
-			this.write_file_header ( file );
-			this.write_navi_field ( file, field );
-			this.write_field_content ( file, field, parent );
-			this.write_file_footer ( file );
-			this.directory_level--;
-			file = null;
-		}
+		this.directory_level++;
+		GLib.FileStream file = GLib.FileStream.open ( path + "index.html", "w");
+		this.write_file_header ( file );
+		this.write_navi_field ( file, field );
+		this.write_field_content ( file, field, parent );
+		this.write_file_footer ( file );
+		this.directory_level--;
+		file = null;
 	}
 
 	public override void visit_delegate ( Delegate del ) {
 		string path = this.current_path + del.name + "/";
 		var rt = DirUtils.create ( path, 0777 );
 
-		if ( this.is_vapi || del.parent is Namespace == false ) {
-			this.directory_level++;
-			GLib.FileStream file = GLib.FileStream.open ( path + "index.html", "w");
-			this.write_file_header ( file );
-			this.write_navi_delegate ( file, del );
-			this.write_delegate_content ( file, del );
-			this.write_file_footer ( file );
-			this.directory_level--;
-			file = null;
-		}
+		this.directory_level++;
+		GLib.FileStream file = GLib.FileStream.open ( path + "index.html", "w");
+		this.write_file_header ( file );
+		this.write_navi_delegate ( file, del );
+		this.write_delegate_content ( file, del );
+		this.write_file_footer ( file );
+		this.directory_level--;
+		file = null;
 	}
 
 	public override void visit_signal ( Signal sig ) {
@@ -1935,24 +1683,25 @@
 		string path = this.current_path + m.name + "/";
 		var rt = DirUtils.create ( path, 0777 );
 
-		if ( this.is_vapi || m.parent is Namespace == false ) {
-			this.directory_level++;
-
-			GLib.FileStream file = GLib.FileStream.open ( path + "index.html", "w");
-			this.write_file_header ( file );
-			this.write_navi_method ( file, m );
-			this.write_method_content ( file, m, parent );
-			this.write_file_footer ( file );
+		this.directory_level++;
+		GLib.FileStream file = GLib.FileStream.open ( path + "index.html", "w");
+		this.write_file_header ( file );
+		this.write_navi_method ( file, m );
+		this.write_method_content ( file, m, parent );
+		this.write_file_footer ( file );
 
-			this.directory_level--;
-			file = null;
-		}
+		this.directory_level--;
+		file = null;
 	}
 
 	public override void visit_namespace ( Namespace ns ) {
 		string old_path = this.current_path;
 		this.directory_level++;
 
+		if ( !this.is_vapi )
+			this.source_namespaces.add ( ns );
+
+
 		if ( ns.name == null ) {
 			string tmp = this.current_path + "0/";
 			this.current_path = tmp;
@@ -1962,22 +1711,13 @@
 			this.current_path = tmp;
 		}
 
-		if ( !this.is_vapi ) {
-			this.add_namespace_bundle ( ns );
-		}
-
-		bool dir_exists = FileUtils.test ( this.current_path, FileTest.EXISTS);
-		if ( !dir_exists ) {
-			var rt = DirUtils.create ( this.current_path, 0777 );
-			if ( this.is_vapi ) {
-				GLib.FileStream file = GLib.FileStream.open ( this.current_path + "index.html", "w" );
-				this.write_file_header ( file );
-				this.write_navi_namespace ( file, ns );
-				this.write_namespace_content ( file, ns );
-				this.write_file_footer ( file );
-				file = null;
-			}
-		}
+		var rt = DirUtils.create ( this.current_path, 0777 );
+		GLib.FileStream file = GLib.FileStream.open ( this.current_path + "index.html", "w" );
+		this.write_file_header ( file );
+		this.write_navi_namespace ( file, ns );
+		this.write_namespace_content ( file, ns );
+		this.write_file_footer ( file );
+		file = null;
 
 		// file:
 		ns.visit_namespaces ( this );

Modified: trunk/src/doclets/html/linkhelper/helper.vala
==============================================================================
--- trunk/src/doclets/html/linkhelper/helper.vala	(original)
+++ trunk/src/doclets/html/linkhelper/helper.vala	Mon Nov  3 00:25:13 2008
@@ -121,7 +121,7 @@
 		Valadoc.Basic pos = tag;
 
 		while ( pos != null ) {
-			if ( pos is Valadoc.File )
+			if ( pos is Valadoc.Package )
 				return pos.name;
 
 			pos = pos.parent;
@@ -129,7 +129,10 @@
 		return null;
 	}
 
-	protected string get_top_link ( Valadoc.Basic postag ) {
+	protected string get_top_link ( Valadoc.Basic? postag ) {
+		if ( postag == null )
+			return "";
+
 		GLib.StringBuilder str = new GLib.StringBuilder ( "" );
 		Valadoc.Basic pos = postag;
 
@@ -140,7 +143,7 @@
 		return str.str;
 	}
 
-	protected string? get_link ( Valadoc.Basic tag, Valadoc.Basic postag ) {
+	protected string? get_link ( Valadoc.Basic tag, Valadoc.Basic? postag ) {
 		if ( !this.settings.to_doc( tag.file_name ) )
 			return null;
 
@@ -149,7 +152,7 @@
 
 		string? link_id = null;
 
-		if ( tag is Valadoc.File == false ) {
+		if ( tag is Valadoc.Package == false ) {
 			if ( tag is Valadoc.EnumValue || tag is Valadoc.ErrorCode ) {
 				link_id = "#"+tag.name;
 				pos = pos.parent;
@@ -163,7 +166,7 @@
 
 				str.prepend ( "/" );
 
-				if ( pos.parent is Valadoc.File )
+				if ( pos.parent is Valadoc.Package )
 					break;
 
 				pos = pos.parent;

Modified: trunk/src/doclets/valadoc.org/doclet/template.vala
==============================================================================
--- trunk/src/doclets/valadoc.org/doclet/template.vala	(original)
+++ trunk/src/doclets/valadoc.org/doclet/template.vala	Mon Nov  3 00:25:13 2008
@@ -486,7 +486,7 @@
 	public override void write_namespace ( Valadoc.Namespace ns, void* ptr ) {
 	}
 
-	public override void write_file ( Valadoc.File file, void* ptr ) {
+	public override void write_file ( Valadoc.Package file, void* ptr ) {
 	}
 }
 
@@ -496,101 +496,6 @@
 
 
 
-private class NamespaceBundle : Object {
-	public NamespaceBundle? parent { construct set; get; }
-	public string? name { construct set; get; }
-	public string path { construct set; get; }
-	public string link { construct set; get; }
-
-	public Gee.ArrayList<NamespaceBundle> subnamespaces = new Gee.ArrayList<NamespaceBundle> ();
-
-	public NamespaceBundle ( string path, string link, string? name, NamespaceBundle? parent = null ) {
-		this.parent = parent;
-		this.name = name;
-		this.path = path;
-		this.link = link;
-	}
-
-	private NamespaceBundle get_namespace_bundle ( Namespace ns ) {
-		foreach ( NamespaceBundle bundle in this.subnamespaces ) {
-			if ( this.name == ns.name ) {
-				return bundle;
-			}
-		}
-
-		NamespaceBundle nsbundle = new NamespaceBundle ( this.path + ns.name + "/", this.link+"::"+ns.name, ns.name, this );
-		this.subnamespaces.add ( nsbundle );
-		return nsbundle;
-	}
-
-	public Gee.ArrayList<ErrorDomain> errordomains = new Gee.ArrayList<ErrorDomain> ();
-	public Gee.ArrayList<Interface> interfaces = new Gee.ArrayList<Interface> ();
-	public Gee.ArrayList<Struct> structs = new Gee.ArrayList<Struct> ();
-	public Gee.ArrayList<Class> classes = new Gee.ArrayList<Class> ();
-	public Gee.ArrayList<Enum> enums = new Gee.ArrayList<Enum> ();
-
-	public Gee.ArrayList<Constant> constants = new Gee.ArrayList<Constant> ();
-	public Gee.ArrayList<Delegate> delegates = new Gee.ArrayList<Delegate> ();
-	public Gee.ArrayList<Method> methods = new Gee.ArrayList<Method> ();
-	public Gee.ArrayList<Field> fields = new Gee.ArrayList<Field> ();
-
-	public void merge_namespace ( Namespace ns ) {
-		Gee.Collection<Namespace> subnamespaces = ns.get_namespace_list ();
-		foreach ( Namespace subns in subnamespaces ) {
-			NamespaceBundle nsbundle = this.get_namespace_bundle ( subns );
-			nsbundle.merge_namespace ( subns );
-		}
-
-		Gee.Collection<ErrorDomain> errordomains = ns.get_error_domain_list ();
-		foreach ( ErrorDomain errdom in errordomains ) {
-			this.errordomains.add ( errdom );
-		}
-
-		Gee.Collection<Interface> interfaces = ns.get_interface_list ();
-		foreach ( Interface iface in interfaces ) {
-			this.interfaces.add ( iface );
-		}
-
-		Gee.Collection<Struct> structs = ns.get_struct_list ();
-		foreach ( Struct stru in structs ) {
-			this.structs.add ( stru );
-		}
-
-		Gee.Collection<Class> classes = ns.get_class_list ();
-		foreach ( Class cl in classes ) {
-			this.classes.add ( cl );
-		}
-
-		Gee.Collection<Enum> enums = ns.get_enum_list ();
-		foreach ( Enum en in enums ) {
-			this.enums.add ( en );
-		}
-
-		Gee.Collection<Constant> constants = ns.get_constant_list ();
-		foreach ( Constant c in constants ) {
-			this.constants.add ( c );
-		}
-
-		Gee.Collection<Delegate> delegates = ns.get_delegate_list ();
-		foreach ( Delegate d in delegates ) {
-			this.delegates.add ( d );
-		}
-
-		Gee.Collection<Method> methods = ns.get_method_list ();
-		foreach ( Method m in methods ) {
-			this.methods.add ( m );
-		}
-
-		Gee.Collection<Field> fields = ns.get_field_list ();
-		foreach ( Field f in fields ) {
-			this.fields.add ( f );
-		}
-	}
-}
-
-
-
-
 
 
 public class Valadoc.HtmlDoclet : Valadoc.Doclet, Valadoc.LinkHelper {
@@ -617,7 +522,7 @@
 			else
 				name = element.name;
 		}
-		else if ( element is File ) {
+		else if ( element is Package ) {
 			string path = this.get_file_name ( element );
 			name = this.get_package_name ( path );
 		}
@@ -652,7 +557,7 @@
 			style = css_navi_class;
 		else if ( element is Interface )
 			style = css_navi_iface;
-		else if ( element is File ) {
+		else if ( element is Package ) {
 			name = this.get_package_name ( element.name );
 			style = css_navi_package;
 		}
@@ -705,7 +610,7 @@
 		}
 	}
 
-	private void write_navi_file ( GLib.FileStream file, File efile ) {
+	private void write_navi_file ( GLib.FileStream file, Package efile ) {
 		Gee.ArrayList<Namespace> ns_list = new Gee.ArrayList<Namespace> ();
 		this.fetch_subnamespace_names (efile, ns_list );
 
@@ -1077,7 +982,7 @@
 		GLib.StringBuilder str = new GLib.StringBuilder ( "" );
 
 		for ( var pos = element; pos != null ; pos = pos.parent ) {
-			if ( pos is File )
+			if ( pos is Package )
 				break;
 
 			str.prepend_unichar ( '/' );
@@ -1126,129 +1031,22 @@
 		file.printf ( "<img cass=\"%s\" src=\"%s\"/>\n", css_diagram, imgpath );
 	}
 
-	public override void visit_file ( File file ) {
+	public override void visit_package ( Package file ) {
 		string package_name = this.get_package_name ( file.name );
-		this.is_vapi = file.name.has_suffix (".vapi");
-
-		stdout.printf ( "File:%s - %s\n", file.name, (this.is_vapi)?"true":"false" );
+		this.is_vapi = file.is_external_package;
 
 		string new_path = this.settings.path + package_name + "/";
-		bool dir_exists = FileUtils.test ( new_path, FileTest.EXISTS);
-
-		if ( !dir_exists ) {
-			var rt = DirUtils.create ( new_path, 0777 );
 
-			GLib.FileStream nav = GLib.FileStream.open ( new_path + "navi.html", "w" );
-			this.write_navi_file ( nav, file );
-		}
+		var rt = DirUtils.create ( new_path, 0777 );
 
+		GLib.FileStream nav = GLib.FileStream.open ( new_path + "navi.html", "w" );
+		this.write_navi_file ( nav, file );
 
 		this.current_path = new_path;
 		file.visit_namespaces ( this );
 		this.current_path = null;
 	}
 
-
-//	private Gee.ArrayList<Namespace> namespaces = new Gee.ArrayList<Namespace> ();
-//  globale Funktionen
-//  globale Konstante
-//  globale Delegates
-//  globale Felder
-
-	private Gee.ArrayList<NamespaceBundle> namespaces = new Gee.ArrayList<NamespaceBundle> ();
-
-	private void add_namespace_bundle ( Namespace ns ) {
-		if ( ns.parent is Namespace )
-			return ;
-
-		foreach ( NamespaceBundle bundle in this.namespaces ) {
-			if ( bundle.name == ns.name ) {
-				bundle.merge_namespace ( ns );
-				return ;
-			}
-		}
-
-		NamespaceBundle bundle = new NamespaceBundle ( this.current_path, this.get_link(ns), ns.name );
-		this.namespaces.add ( bundle );
-		bundle.merge_namespace ( ns );
-	}
-
-	private void write_navi_namespace_bundle_path_navigation ( NamespaceBundle nsbundle, GLib.FileStream navi, Basic mself = null ) {
-		Gee.ArrayList<NamespaceBundle> parents = new Gee.ArrayList<NamespaceBundle> ();
-		for ( NamespaceBundle nsb = nsbundle.parent; nsb != null ; nsb = nsb.parent ) {
-			parents.insert ( 0, nsb );
-		}
-
-		this.write_top_element ( navi );
-
-		foreach ( NamespaceBundle nsb in parents ) {
-			navi.printf ( "<ul class=\"%s\">\n", css_navi );
-			this.write_navi_entry_html_template_with_link ( navi, css_navi_namespace, nsb.path + "navi.html", nsb.name );
-			navi.puts ( "</ul>\n" );
-			navi.printf ( "\n<hr class=\"%s\">\n", css_navi_hr );
-		}
-
-
-		navi.printf ( "<ul class=\"%s\">\n", css_navi );
-		if ( mself == null ) {
-			this.write_navi_entry_html_template ( navi, css_navi_namespace, nsbundle.name );
-		}
-		else {
-			this.write_navi_entry_html_template_with_link ( navi, css_navi_namespace, nsbundle.path + "navi.html", nsbundle.name );
-		}
-		navi.puts ( "</ul>\n" );
-		navi.printf ( "\n<hr class=\"%s\">\n", css_navi_hr );
-
-		navi.printf ( "<ul class=\"%s\">\n", css_navi );
-		foreach ( NamespaceBundle nsb in nsbundle.subnamespaces ) {
-			this.write_navi_entry_html_template_with_link ( navi, css_navi_namespace, nsb.link, (nsb.name == null)? "Global Namespace" : nsb.name );
-		}
-
-		this.write_navi_child_classes_without_childs_collection ( navi, nsbundle.classes, mself );
-		this.write_navi_child_interfaces_without_childs_collection ( navi, nsbundle.interfaces, mself );
-		this.write_navi_child_structs_without_childs_collection ( navi, nsbundle.structs, mself );
-		this.write_navi_child_enums_without_childs_collection ( navi, nsbundle.enums, mself );
-		this.write_navi_child_error_domains_without_childs_collection ( navi, nsbundle.errordomains, mself );
-		this.write_navi_child_delegates_collection ( navi, nsbundle.delegates, mself );
-		this.write_navi_child_methods_collection ( navi, nsbundle.methods, mself );
-		this.write_navi_child_fields_collection ( navi, nsbundle.fields, mself );
-		this.write_navi_child_constants_collection ( navi, nsbundle.constants, mself );
-		navi.puts ( "</ul>\n" );
-	}
-
-	private void write_navi_namespace_bundle ( NamespaceBundle nsbundle, Basic mself = null ) {
-		foreach ( NamespaceBundle subnsbundle in nsbundle.subnamespaces ) {
-			this.write_navi_namespace_bundle ( subnsbundle );
-		}
-
-		foreach ( Delegate del in nsbundle.delegates ) {
-			GLib.FileStream navi = GLib.FileStream.open ( nsbundle.path + del.name + "/navi.html", "w" );
-			this.write_navi_namespace_bundle_path_navigation ( nsbundle, navi, del );
-		}
-		foreach ( Method m in nsbundle.methods ) {
-			GLib.FileStream navi = GLib.FileStream.open ( nsbundle.path + m.name + "/navi.html", "w" );
-			this.write_navi_namespace_bundle_path_navigation ( nsbundle, navi, m );
-		}
-		foreach ( Field f in nsbundle.fields ) {
-			GLib.FileStream navi = GLib.FileStream.open ( nsbundle.path + f.name + "/navi.html", "w" );
-			this.write_navi_namespace_bundle_path_navigation ( nsbundle, navi, f );
-		} 
-		foreach ( Constant c in nsbundle.constants ) {
-			GLib.FileStream navi = GLib.FileStream.open ( nsbundle.path + c.name + "/navi.html", "w" );
-			this.write_navi_namespace_bundle_path_navigation ( nsbundle, navi, c );
-		}
-
-
-		GLib.FileStream navi = GLib.FileStream.open ( nsbundle.path + "navi.html", "w" );
-		this.write_navi_namespace_bundle_path_navigation ( nsbundle, navi, mself );
-	}
-
-	~HtmlDoclet () {
-		foreach ( NamespaceBundle nsbundle in this.namespaces ) {
-			this.write_navi_namespace_bundle ( nsbundle );
-		}
-	}
-
 	public void write_namespace_content ( GLib.FileStream file, Namespace ns ) {
 		file.printf ( "<h1 class=\"%s\">%s:</h1>\n", css_title, (ns.name == null)? "Global Namespace" : ns.full_name() );
 		file.printf ( "<hr class=\"%s\" />\n", css_hr );
@@ -1268,24 +1066,15 @@
 			this.current_path = tmp;
 		}
 
-		if ( !this.is_vapi ) {
-			this.add_namespace_bundle ( ns );
-		}
+		var rt = DirUtils.create ( this.current_path, 0777 );
 
-		bool dir_exists = FileUtils.test ( this.current_path, FileTest.EXISTS);
-		if ( !dir_exists ) {
-			var rt = DirUtils.create ( this.current_path, 0777 );
-
-			if ( this.is_vapi ) {
-				GLib.FileStream navi = GLib.FileStream.open ( this.current_path + "navi.html", "w" );
-				this.write_navi_child_namespaces ( navi, ns );
-				navi = null;
-			}
+		GLib.FileStream navi = GLib.FileStream.open ( this.current_path + "navi.html", "w" );
+		this.write_navi_child_namespaces ( navi, ns );
+		navi = null;
 
-			GLib.FileStream file = GLib.FileStream.open ( this.current_path + "index.html", "w" );
-			this.write_namespace_content ( file, ns );
-			file = null;
-		}
+		GLib.FileStream file = GLib.FileStream.open ( this.current_path + "index.html", "w" );
+		this.write_namespace_content ( file, ns );
+		file = null;
 
 		// file:
 		ns.visit_namespaces ( this );
@@ -1772,11 +1561,9 @@
 		string path = this.current_path + constant.name + "/";
 		var rt = DirUtils.create ( path, 0777 );
 
-		if ( this.is_vapi || constant.parent is Namespace == false ) {
-			GLib.FileStream navi = GLib.FileStream.open ( path + "navi.html", "w" );
-			this.write_navi_constant ( navi, constant );
-			navi = null;
-		}
+		GLib.FileStream navi = GLib.FileStream.open ( path + "navi.html", "w" );
+		this.write_navi_constant ( navi, constant );
+		navi = null;
 
 		GLib.FileStream file = GLib.FileStream.open ( path + "index.html", "w");
 		this.write_constant_content ( file, constant, parent );
@@ -1817,11 +1604,9 @@
 		}
 		cname = null;
 
-		if ( this.is_vapi || field.parent is Namespace == false ) {
-			GLib.FileStream navi = GLib.FileStream.open ( path + "navi.html", "w" );
-			this.write_navi_field ( navi, field );
-			navi = null;
-		}
+		GLib.FileStream navi = GLib.FileStream.open ( path + "navi.html", "w" );
+		this.write_navi_field ( navi, field );
+		navi = null;
 
 		GLib.FileStream file = GLib.FileStream.open ( path + "index.html", "w");
 		this.write_field_content ( file, field, parent );
@@ -1853,11 +1638,9 @@
 		string path = this.current_path + del.name + "/";
 		var rt = DirUtils.create ( path, 0777 );
 
-		if ( this.is_vapi || del.parent is Namespace == false ) {
-			GLib.FileStream cname = GLib.FileStream.open ( path + "cname", "w" );
-			cname.puts ( del.get_cname() );
-			cname = null;
-		}
+		GLib.FileStream cname = GLib.FileStream.open ( path + "cname", "w" );
+		cname.puts ( del.get_cname() );
+		cname = null;
 
 		GLib.FileStream navi = GLib.FileStream.open ( path + "navi.html", "w" );
 		this.write_navi_delegate ( navi, del );
@@ -1921,11 +1704,9 @@
 		string full_name = m.full_name ();
 		var rt = DirUtils.create ( path, 0777 );
 
-		if ( this.is_vapi || m.parent is Namespace == false ) {
-			GLib.FileStream cname = GLib.FileStream.open ( path + "cname", "w" );
-			cname.puts ( m.get_cname () );
-			cname = null;
-		}
+		GLib.FileStream cname = GLib.FileStream.open ( path + "cname", "w" );
+		cname.puts ( m.get_cname () );
+		cname = null;
 
 		GLib.FileStream navi = GLib.FileStream.open ( path + "navi.html", "w" );
 		this.write_navi_method ( navi, m );

Modified: trunk/src/doclets/valadoc.org/linkhelper/helper.vala
==============================================================================
--- trunk/src/doclets/valadoc.org/linkhelper/helper.vala	(original)
+++ trunk/src/doclets/valadoc.org/linkhelper/helper.vala	Mon Nov  3 00:25:13 2008
@@ -117,7 +117,7 @@
 		Valadoc.Basic pos = tag;
 
 		while ( pos != null ) {
-			if ( pos is Valadoc.File )
+			if ( pos is Valadoc.Package )
 				return pos.name;
 
 			pos = pos.parent;
@@ -132,7 +132,7 @@
 		GLib.StringBuilder str = new GLib.StringBuilder ( "" );
 		Valadoc.Basic pos = tag;
 
-		if ( tag is Valadoc.File == false ) {
+		if ( tag is Valadoc.Package == false ) {
 			if ( tag is Valadoc.EnumValue || tag is Valadoc.ErrorCode ) {
 				str.append_unichar ( '#' );
 				str.append ( tag.name );
@@ -147,7 +147,7 @@
 
 				str.prepend ( "::" );
 
-				if ( pos.parent is Valadoc.File )
+				if ( pos.parent is Valadoc.Package )
 					break;
 
 				pos = pos.parent;

Modified: trunk/src/libvaladoc/doclet.vala
==============================================================================
--- trunk/src/libvaladoc/doclet.vala	(original)
+++ trunk/src/libvaladoc/doclet.vala	Mon Nov  3 00:25:13 2008
@@ -29,7 +29,7 @@
 public abstract class Valadoc.Doclet : GLib.Object {
 	public abstract void initialisation ( Settings settings );
 
-	public abstract void visit_file ( File file );
+	public abstract void visit_package ( Package pkg );
 
 	public abstract void visit_namespace ( Namespace ns );
 

Modified: trunk/src/libvaladoc/doctree.vala
==============================================================================
--- trunk/src/libvaladoc/doctree.vala	(original)
+++ trunk/src/libvaladoc/doctree.vala	Mon Nov  3 00:25:13 2008
@@ -139,7 +139,7 @@
 			this._full_name = this.name;
 			Basic pos = this.parent;
 
-			while ( pos is File == false ) {
+			while ( pos is Package == false ) {
 				if ( pos.name != null )
 					this._full_name = pos.name + "." + this._full_name;
 
@@ -248,7 +248,7 @@
 		get {
 			Basic element = this;
 			while ( element != null ) {
-				if ( element is File )
+				if ( element is Package )
 					return element.name;
 
 				element = element.parent;
@@ -258,15 +258,15 @@
 	}
 
 	// construct set -> creation method
-	public File? file {
+	public Package? file {
 		get {
 			Valadoc.Basic ast = this;
-			while ( ast is Valadoc.File == false ) {
+			while ( ast is Valadoc.Package == false ) {
 				ast = ast.parent;
 				if ( ast == null )
 					return null;
 			}
-			return (Valadoc.File)ast;
+			return (Valadoc.Package)ast;
 		}
 	}
 
@@ -4186,35 +4186,41 @@
 	}
 }
 
-public class Valadoc.File : Basic, NamespaceHandler {
+// rename to Package
+public class Valadoc.Package : Basic, NamespaceHandler {
 	public Gee.ArrayList<Namespace> namespaces {
 		default = new Gee.ArrayList<Namespace>();
 		private set;
 		private get;
 	}
 
-	public bool is_package {
-		get {
-			return this.vfile.external_package;
-		}
+	public bool is_external_package {
+		 private set;
+		 get;
 	}
 
-	public File ( Valadoc.Settings settings, Vala.SourceFile vfile, Tree head ) {
+	public Package ( Valadoc.Settings settings, Vala.SourceFile vfile, Tree head ) {
 		this.settings = settings;
-		this.vfile = vfile;
 		this.head = head;
+
+		this.package_name = vfile.filename;
+		this.is_external_package = !( this.package_name.has_suffix ( ".vala" ) || this.package_name.has_suffix ( ".gs" ) );
 	}
 
+	private string package_name;
+
 	public override string?# name {
 		get {
-			return this.vfile.filename;
+			return package_name;
 		}
 	}
 
+/*
 	public Vala.SourceFile vfile {
 		construct set;
 		private get;
 	}
+*/
 
 	// internal
 	public override weak Basic? search_element ( string[] params, int pos ) {
@@ -4237,15 +4243,23 @@
 	}
 
 	// internal
-	public bool is_file ( Vala.SourceFile vfile ) {
-		return ( vfile == this.vfile );
+	public bool is_package ( Vala.SourceFile vfile ) {
+		bool vheader = !( vfile.filename.has_suffix ( ".vala" ) || vfile.filename.has_suffix ( ".gs" ) );
+		if ( vheader == false && this.is_external_package == false ) {
+			return true;
+		}
+		else if ( vheader == true && this.is_external_package == true ) {
+			if ( vfile.filename == this.package_name )
+				return true;
+		}
+		return false;
 	}
 
 	public void visit ( Doclet doclet ) {
 		if ( !settings.to_doc ( this.name ) )
 			return ;
 
-		doclet.visit_file ( this );
+		doclet.visit_package ( this );
 	}
 
 	// internal
@@ -4271,7 +4285,7 @@
 
 
 public class Valadoc.Tree : Vala.CodeVisitor {
-	private Gee.ArrayList<File> files = new Gee.ArrayList<File>();
+	private Gee.ArrayList<Package> files = new Gee.ArrayList<Package>();
 
 	public Valadoc.Settings settings {
 		construct set;
@@ -4289,7 +4303,7 @@
 	}
 
 	public void visit ( Doclet doclet ) {
-		foreach ( File file in this.files ) {
+		foreach ( Package file in this.files ) {
 			file.visit ( doclet );
 		}
 	}
@@ -4338,7 +4352,7 @@
 			global_params[i+1] = params[i];
 		}
 
-		foreach ( File f in this.files ) {
+		foreach ( Package f in this.files ) {
 			Basic element = f.search_element ( global_params, 0 );
 			if ( element != null )
 				return element;
@@ -4347,7 +4361,7 @@
 	}
 
 	private weak Basic? search_symbol_in_namespaces ( Basic element, string[] params ) {
-		foreach ( File f in this.files ) {
+		foreach ( Package f in this.files ) {
 			Basic element = f.search_element ( params, 0 );
 			if ( element != null )
 				return element;
@@ -4395,7 +4409,7 @@
 			return ;
 
 		Vala.SourceFile vfile = vcl.source_reference.file;
-		File file = this.get_file ( vfile );
+		Package file = this.get_file ( vfile );
 		Namespace ns = file.get_namespace ( vcl );
 		ns.add_class ( vcl );
 	}
@@ -4405,7 +4419,7 @@
 			return ;
 
 		Vala.SourceFile vfile = viface.source_reference.file;
-		File file = this.get_file ( vfile );
+		Package file = this.get_file ( vfile );
 		Namespace ns = file.get_namespace ( viface );
 		ns.add_interface ( viface );
 	}
@@ -4415,7 +4429,7 @@
 			return ;
 
 		Vala.SourceFile vfile = vstru.source_reference.file;
-		File file = this.get_file ( vfile );
+		Package file = this.get_file ( vfile );
 		Namespace ns = file.get_namespace ( vstru );
 		ns.add_struct ( vstru );
 	}
@@ -4425,7 +4439,7 @@
 			return ;
 
 		Vala.SourceFile vfile = vf.source_reference.file;
-		File file = this.get_file ( vfile );
+		Package file = this.get_file ( vfile );
 		Namespace ns = file.get_namespace ( vf );
 		ns.add_field ( vf );
 	}
@@ -4435,7 +4449,7 @@
 			return ;
 
 		Vala.SourceFile vfile = vm.source_reference.file;
-		File file = this.get_file ( vfile );
+		Package file = this.get_file ( vfile );
 		Namespace ns = file.get_namespace ( vm );
 		ns.add_method ( vm );
 	}
@@ -4445,7 +4459,7 @@
 			return ;
 
 		Vala.SourceFile vfile = vd.source_reference.file;
-		File file = this.get_file ( vfile );
+		Package file = this.get_file ( vfile );
 		Namespace ns = file.get_namespace ( vd );
 		ns.add_delegate ( vd );
 	}
@@ -4455,7 +4469,7 @@
 			return ;
 
 		Vala.SourceFile vfile = venum.source_reference.file;
-		File file = this.get_file ( vfile );
+		Package file = this.get_file ( vfile );
 		Namespace ns = file.get_namespace ( venum );
 		ns.add_enum ( venum );
 	}
@@ -4465,7 +4479,7 @@
 			return ;
 
 		Vala.SourceFile vfile = vc.source_reference.file;
-		File file = this.get_file ( vfile );
+		Package file = this.get_file ( vfile );
 		Namespace ns = file.get_namespace ( vc );
 		ns.add_constant ( vc );
 	}
@@ -4475,7 +4489,7 @@
 			return ;
 
 		Vala.SourceFile vfile = verrdom.source_reference.file;
-		File file = this.get_file ( vfile );
+		Package file = this.get_file ( vfile );
 		Namespace ns = file.get_namespace ( verrdom );
 		ns.add_error_domain ( verrdom );
 	}
@@ -4487,28 +4501,28 @@
 	}
 
 	// internal
-	public File? find_file ( Vala.SourceFile vfile ) {
-		foreach ( File f in this.files ) {
-			if ( f.is_file( vfile ) )
+	public Package? find_file ( Vala.SourceFile vfile ) {
+		foreach ( Package f in this.files ) {
+			if ( f.is_package( vfile ) )
 				return f;
 		}
 		return null;
 	}
 
 	private void set_type_references ( ) {
-		foreach ( File f in this.files ) {
+		foreach ( Package f in this.files ) {
 			f.set_type_references( );
 		}
 	}
 
 	private void inheritance ( ) {
-		foreach ( File f in this.files ) {
+		foreach ( Package f in this.files ) {
 			f.inheritance( );
 		}
 	}
 
 	public void parse_comments ( Valadoc.Parser docparser ) {
-		foreach ( File f in this.files ) {
+		foreach ( Package f in this.files ) {
 			f.parse_comments( docparser );
 		}
 	}
@@ -4536,18 +4550,18 @@
 		}
 
 		Vala.SourceFile vfile = vnode.source_reference.file;
-		File file = this.get_file ( vfile );
+		Package file = this.get_file ( vfile );
 
 		return file.search_element_vala ( params, 0 );
 	}
 
 	// internal
-	public File get_file ( Vala.SourceFile vfile ) {
-		File file = this.find_file( vfile );
+	public Package get_file ( Vala.SourceFile vfile ) {
+		Package file = this.find_file( vfile );
 		if ( file != null )
 			return file;
 
-		var tmp = new File ( this.settings,vfile, this ); 
+		var tmp = new Package ( this.settings,vfile, this ); 
 		this.files.add ( tmp );
 		return tmp;
 	}

Modified: trunk/src/libvaladoc/langlet.vala
==============================================================================
--- trunk/src/libvaladoc/langlet.vala	(original)
+++ trunk/src/libvaladoc/langlet.vala	Mon Nov  3 00:25:13 2008
@@ -87,7 +87,7 @@
 	public virtual void write_namespace ( Valadoc.Namespace ns, void* ptr ) {
 	}
 
-	public virtual void write_file ( Valadoc.File file, void* ptr ) {
+	public virtual void write_file ( Valadoc.Package file, void* ptr ) {
 	}
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]