From: Florian Brosch Date: Fri, 27 Jan 2012 02:20:30 +0000 (+0100) Subject: Embedded: Search images relative to the file X-Git-Tag: 0.37.1~3^2~235 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f4829ba44ea261c80e6d7971be664c157b48e9b;p=thirdparty%2Fvala.git Embedded: Search images relative to the file --- diff --git a/src/libvaladoc/content/blockcontent.vala b/src/libvaladoc/content/blockcontent.vala index e46617797..d3d8a984a 100755 --- a/src/libvaladoc/content/blockcontent.vala +++ b/src/libvaladoc/content/blockcontent.vala @@ -1,6 +1,7 @@ /* blockcontent.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -34,9 +35,9 @@ public abstract class Valadoc.Content.BlockContent : ContentElement { public override void configure (Settings settings, ResourceLocator locator) { } - public override void check (Api.Tree api_root, Api.Node container, ErrorReporter reporter, Settings settings) { + public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { foreach (Block element in _content) { - element.check (api_root, container, reporter, settings); + element.check (api_root, container, file_path, reporter, settings); } } diff --git a/src/libvaladoc/content/comment.vala b/src/libvaladoc/content/comment.vala index 6978b8f11..0c6f4496f 100755 --- a/src/libvaladoc/content/comment.vala +++ b/src/libvaladoc/content/comment.vala @@ -1,6 +1,7 @@ /* comment.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -36,11 +37,11 @@ public class Valadoc.Content.Comment : BlockContent { public override void configure (Settings settings, ResourceLocator locator) { } - public override void check (Api.Tree api_root, Api.Node container, ErrorReporter reporter, Settings settings) { - base.check (api_root, container, reporter, settings); + public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { + base.check (api_root, container, file_path, reporter, settings); foreach (Taglet element in _taglets) { - element.check (api_root, container, reporter, settings); + element.check (api_root, container, file_path, reporter, settings); } } diff --git a/src/libvaladoc/content/contentelement.vala b/src/libvaladoc/content/contentelement.vala index 427cf6607..be15e5bbd 100755 --- a/src/libvaladoc/content/contentelement.vala +++ b/src/libvaladoc/content/contentelement.vala @@ -1,6 +1,7 @@ /* contentelement.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,7 +29,7 @@ public abstract class Valadoc.Content.ContentElement : Object { public virtual void configure (Settings settings, ResourceLocator locator) { } - public abstract void check (Api.Tree api_root, Api.Node container, ErrorReporter reporter, Settings settings); + public abstract void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings); public abstract void accept (ContentVisitor visitor); diff --git a/src/libvaladoc/content/contentfactory.vala b/src/libvaladoc/content/contentfactory.vala index 19cf41be2..dda8a8763 100755 --- a/src/libvaladoc/content/contentfactory.vala +++ b/src/libvaladoc/content/contentfactory.vala @@ -1,6 +1,7 @@ /* contentfactory.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/libvaladoc/content/contentvisitor.vala b/src/libvaladoc/content/contentvisitor.vala index 3eb3a4b3d..d1b14c453 100755 --- a/src/libvaladoc/content/contentvisitor.vala +++ b/src/libvaladoc/content/contentvisitor.vala @@ -1,6 +1,7 @@ /* contentvisitor.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/libvaladoc/content/embedded.vala b/src/libvaladoc/content/embedded.vala index f158800aa..b8f422258 100755 --- a/src/libvaladoc/content/embedded.vala +++ b/src/libvaladoc/content/embedded.vala @@ -1,6 +1,7 @@ /* embedded.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -42,7 +43,18 @@ public class Valadoc.Content.Embedded : ContentElement, Inline, StyleAttributes _locator = locator; } - public override void check (Api.Tree api_root, Api.Node container, ErrorReporter reporter, Settings settings) { + public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { + // search relative to our file + if (!Path.is_absolute (url)) { + string relative_to_file = Path.build_path (Path.DIR_SEPARATOR_S, Path.get_dirname (file_path), url); + if (FileUtils.test (relative_to_file, FileTest.EXISTS | FileTest.IS_REGULAR)) { + url = (owned) relative_to_file; + package = container.package; + return ; + } + } + + // search relative to the current directory / absoulte path if (!FileUtils.test (url, FileTest.EXISTS | FileTest.IS_REGULAR)) { reporter.simple_error ("%s does not exist", url); } else { diff --git a/src/libvaladoc/content/headline.vala b/src/libvaladoc/content/headline.vala index c7fcb29ce..36b19c23b 100755 --- a/src/libvaladoc/content/headline.vala +++ b/src/libvaladoc/content/headline.vala @@ -1,6 +1,7 @@ /* headline.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -31,12 +32,12 @@ public class Valadoc.Content.Headline : Block, InlineContent { _level = 0; } - public override void check (Api.Tree api_root, Api.Node container, ErrorReporter reporter, Settings settings) { + public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { // TODO report error if level == 0 ? // TODO: content.size == 0? // Check inline content - base.check (api_root, container, reporter, settings); + base.check (api_root, container, file_path, reporter, settings); } public override void accept (ContentVisitor visitor) { diff --git a/src/libvaladoc/content/inlinecontent.vala b/src/libvaladoc/content/inlinecontent.vala index 389c66b96..119f0569d 100755 --- a/src/libvaladoc/content/inlinecontent.vala +++ b/src/libvaladoc/content/inlinecontent.vala @@ -1,6 +1,7 @@ /* inlinecontent.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -35,9 +36,9 @@ public abstract class Valadoc.Content.InlineContent : ContentElement { internal InlineContent () { } - public override void check (Api.Tree api_root, Api.Node container, ErrorReporter reporter, Settings settings) { + public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { foreach (Inline element in _content) { - element.check (api_root, container, reporter, settings); + element.check (api_root, container, file_path, reporter, settings); } } diff --git a/src/libvaladoc/content/inlinetaglet.vala b/src/libvaladoc/content/inlinetaglet.vala index 813bcf339..151395095 100755 --- a/src/libvaladoc/content/inlinetaglet.vala +++ b/src/libvaladoc/content/inlinetaglet.vala @@ -1,6 +1,7 @@ /* taglet.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -48,9 +49,9 @@ public abstract class Valadoc.Content.InlineTaglet : ContentElement, Taglet, Inl this.locator = locator; } - public override void check (Api.Tree api_root, Api.Node container, ErrorReporter reporter, Settings settings) { + public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { ContentElement element = get_content (); - element.check (api_root, container, reporter, settings); + element.check (api_root, container, file_path, reporter, settings); } public override void accept (ContentVisitor visitor) { diff --git a/src/libvaladoc/content/link.vala b/src/libvaladoc/content/link.vala index e114e9694..e2648981a 100755 --- a/src/libvaladoc/content/link.vala +++ b/src/libvaladoc/content/link.vala @@ -1,6 +1,7 @@ /* link.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -33,7 +34,7 @@ public class Valadoc.Content.Link : InlineContent, Inline { public override void configure (Settings settings, ResourceLocator locator) { } - public override void check (Api.Tree api_root, Api.Node container, ErrorReporter reporter, Settings settings) { + public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { //TODO: check url } diff --git a/src/libvaladoc/content/list.vala b/src/libvaladoc/content/list.vala index c7bae59a8..e55489fe1 100755 --- a/src/libvaladoc/content/list.vala +++ b/src/libvaladoc/content/list.vala @@ -1,6 +1,7 @@ /* list.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -108,10 +109,10 @@ public class Valadoc.Content.List : ContentElement, Block { _items = new ArrayList (); } - public override void check (Api.Tree api_root, Api.Node container, ErrorReporter reporter, Settings settings) { + public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { // Check individual list items foreach (ListItem element in _items) { - element.check (api_root, container, reporter, settings); + element.check (api_root, container, file_path, reporter, settings); } } diff --git a/src/libvaladoc/content/listitem.vala b/src/libvaladoc/content/listitem.vala index f6907964e..ef5f589f7 100755 --- a/src/libvaladoc/content/listitem.vala +++ b/src/libvaladoc/content/listitem.vala @@ -1,6 +1,7 @@ /* listitem.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -30,12 +31,12 @@ public class Valadoc.Content.ListItem : InlineContent { base (); } - public override void check (Api.Tree api_root, Api.Node container, ErrorReporter reporter, Settings settings) { + public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { // Check inline content - base.check (api_root, container, reporter, settings); + base.check (api_root, container, file_path, reporter, settings); if (sub_list != null) { - sub_list.check (api_root, container, reporter, settings); + sub_list.check (api_root, container, file_path, reporter, settings); } } diff --git a/src/libvaladoc/content/note.vala b/src/libvaladoc/content/note.vala index d2b16c557..40bb93019 100755 --- a/src/libvaladoc/content/note.vala +++ b/src/libvaladoc/content/note.vala @@ -1,6 +1,7 @@ /* note.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,9 +29,9 @@ public class Valadoc.Content.Note : BlockContent, Block { base (); } - public override void check (Api.Tree api_root, Api.Node container, ErrorReporter reporter, Settings settings) { + public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { // Check inline content - base.check (api_root, container, reporter, settings); + base.check (api_root, container, file_path, reporter, settings); } public override void accept (ContentVisitor visitor) { diff --git a/src/libvaladoc/content/paragraph.vala b/src/libvaladoc/content/paragraph.vala index 8f89b48b3..4998952d4 100755 --- a/src/libvaladoc/content/paragraph.vala +++ b/src/libvaladoc/content/paragraph.vala @@ -1,6 +1,7 @@ /* paragraph.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -32,9 +33,9 @@ public class Valadoc.Content.Paragraph : InlineContent, Block, StyleAttributes { base (); } - public override void check (Api.Tree api_root, Api.Node container, ErrorReporter reporter, Settings settings) { + public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { // Check inline content - base.check (api_root, container, reporter, settings); + base.check (api_root, container, file_path, reporter, settings); } public override void accept (ContentVisitor visitor) { diff --git a/src/libvaladoc/content/run.vala b/src/libvaladoc/content/run.vala index 519b424fe..146d9c29e 100755 --- a/src/libvaladoc/content/run.vala +++ b/src/libvaladoc/content/run.vala @@ -1,6 +1,7 @@ /* run.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -117,9 +118,9 @@ public class Valadoc.Content.Run : InlineContent, Inline { _style = style; } - public override void check (Api.Tree api_root, Api.Node container, ErrorReporter reporter, Settings settings) { + public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { // Check inline content - base.check (api_root, container, reporter, settings); + base.check (api_root, container, file_path, reporter, settings); } public override void accept (ContentVisitor visitor) { diff --git a/src/libvaladoc/content/sourcecode.vala b/src/libvaladoc/content/sourcecode.vala index fb2bd625e..338d23b24 100755 --- a/src/libvaladoc/content/sourcecode.vala +++ b/src/libvaladoc/content/sourcecode.vala @@ -1,6 +1,7 @@ /* sourcecode.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -64,7 +65,7 @@ public class Valadoc.Content.SourceCode : ContentElement, Inline{ _language = Language.VALA; } - public override void check (Api.Tree api_root, Api.Node container, ErrorReporter reporter, Settings settings) { + public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { } public override void accept (ContentVisitor visitor) { diff --git a/src/libvaladoc/content/symbollink.vala b/src/libvaladoc/content/symbollink.vala index ef52b3010..aff9476e2 100755 --- a/src/libvaladoc/content/symbollink.vala +++ b/src/libvaladoc/content/symbollink.vala @@ -1,6 +1,7 @@ /* symbollink.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -36,7 +37,7 @@ public class Valadoc.Content.SymbolLink : ContentElement, Inline { public override void configure (Settings settings, ResourceLocator locator) { } - public override void check (Api.Tree api_root, Api.Node container, ErrorReporter reporter, Settings settings) { + public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { } public override void accept (ContentVisitor visitor) { diff --git a/src/libvaladoc/content/table.vala b/src/libvaladoc/content/table.vala index dc232ae20..17fa589e8 100755 --- a/src/libvaladoc/content/table.vala +++ b/src/libvaladoc/content/table.vala @@ -1,6 +1,7 @@ /* table.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -33,12 +34,12 @@ public class Valadoc.Content.Table : ContentElement, Block { _rows = new ArrayList (); } - public override void check (Api.Tree api_root, Api.Node container, ErrorReporter reporter, Settings settings) { + public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { // Check the table consistency in term of row/column number // Check individual rows foreach (var row in _rows) { - row.check (api_root, container, reporter, settings); + row.check (api_root, container, file_path, reporter, settings); } } diff --git a/src/libvaladoc/content/tablecell.vala b/src/libvaladoc/content/tablecell.vala index 01e732f09..733aad1ca 100755 --- a/src/libvaladoc/content/tablecell.vala +++ b/src/libvaladoc/content/tablecell.vala @@ -1,6 +1,7 @@ /* tablecell.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -36,9 +37,9 @@ public class Valadoc.Content.TableCell : InlineContent, StyleAttributes { _rowspan = 1; } - public override void check (Api.Tree api_root, Api.Node container, ErrorReporter reporter, Settings settings) { + public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { // Check inline content - base.check (api_root, container, reporter, settings); + base.check (api_root, container, file_path, reporter, settings); } public override void accept (ContentVisitor visitor) { diff --git a/src/libvaladoc/content/tablerow.vala b/src/libvaladoc/content/tablerow.vala index 943c95f64..5cd59fd4b 100755 --- a/src/libvaladoc/content/tablerow.vala +++ b/src/libvaladoc/content/tablerow.vala @@ -1,6 +1,7 @@ /* tablerow.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -33,10 +34,10 @@ public class Valadoc.Content.TableRow : ContentElement { _cells = new ArrayList (); } - public override void check (Api.Tree api_root, Api.Node container, ErrorReporter reporter, Settings settings) { + public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { // Check individual cells foreach (var cell in _cells) { - cell.check (api_root, container, reporter, settings); + cell.check (api_root, container, file_path, reporter, settings); } } diff --git a/src/libvaladoc/content/text.vala b/src/libvaladoc/content/text.vala index 2b147235d..6d3877e87 100755 --- a/src/libvaladoc/content/text.vala +++ b/src/libvaladoc/content/text.vala @@ -1,6 +1,7 @@ /* text.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -36,7 +37,7 @@ public class Valadoc.Content.Text : ContentElement, Inline { } } - public override void check (Api.Tree api_root, Api.Node container, ErrorReporter reporter, Settings settings) { + public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { } public override void accept (ContentVisitor visitor) { diff --git a/src/libvaladoc/content/warning.vala b/src/libvaladoc/content/warning.vala index e848c43f3..3ab9b3c73 100755 --- a/src/libvaladoc/content/warning.vala +++ b/src/libvaladoc/content/warning.vala @@ -1,6 +1,7 @@ /* warning.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,9 +29,9 @@ public class Valadoc.Content.Warning : BlockContent, Block { base (); } - public override void check (Api.Tree api_root, Api.Node container, ErrorReporter reporter, Settings settings) { + public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { // Check inline content - base.check (api_root, container, reporter, settings); + base.check (api_root, container, file_path, reporter, settings); } public override void accept (ContentVisitor visitor) { diff --git a/src/libvaladoc/content/wikilink.vala b/src/libvaladoc/content/wikilink.vala index e88bc18f7..e08719f6a 100755 --- a/src/libvaladoc/content/wikilink.vala +++ b/src/libvaladoc/content/wikilink.vala @@ -1,6 +1,7 @@ /* link.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -34,7 +35,7 @@ public class Valadoc.Content.WikiLink : InlineContent, Inline { public override void configure (Settings settings, ResourceLocator locator) { } - public override void check (Api.Tree api_root, Api.Node container, ErrorReporter reporter, Settings settings) { + public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { page = api_root.wikitree.search (name); if (page == null) { reporter.simple_warning ("%s does not exist".printf (name)); diff --git a/src/libvaladoc/documentation/documentationparser.vala b/src/libvaladoc/documentation/documentationparser.vala index f4a9667cd..5fa736a5a 100755 --- a/src/libvaladoc/documentation/documentationparser.vala +++ b/src/libvaladoc/documentation/documentationparser.vala @@ -1,6 +1,7 @@ /* documentationparser.vala * - * Copyright (C) 2008-2011 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -76,7 +77,7 @@ public class Valadoc.DocumentationParser : Object, ResourceLocator { public Comment? parse_comment_str (Api.Node element, string content, string filename, int first_line, int first_column) { try { Comment doc_comment = parse_comment (content, filename, first_line, first_column); - doc_comment.check (_tree, element, _reporter, _settings); + doc_comment.check (_tree, element, filename, _reporter, _settings); return doc_comment; } catch (ParserError error) { return null; @@ -94,7 +95,7 @@ public class Valadoc.DocumentationParser : Object, ResourceLocator { try { Page documentation = parse_wiki (page.documentation_str, page.get_filename ()); - documentation.check (_tree, pkg, _reporter, _settings); + documentation.check (_tree, pkg, page.path, _reporter, _settings); return documentation; } catch (ParserError error) { return null; diff --git a/src/libvaladoc/documentation/gtkdoccommentparser.vala b/src/libvaladoc/documentation/gtkdoccommentparser.vala index 574e65fab..b1486069d 100644 --- a/src/libvaladoc/documentation/gtkdoccommentparser.vala +++ b/src/libvaladoc/documentation/gtkdoccommentparser.vala @@ -1,6 +1,6 @@ /* gtkcommentparser.vala * - * Copyright (C) 2011 Florian Brosch + * Copyright (C) 2011-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -260,7 +260,7 @@ public class Valadoc.Gtkdoc.Parser : Object, ResourceLocator { first = false; } - comment.check (tree, element, reporter, settings); + comment.check (tree, element, gir_comment.file.relative_path, reporter, settings); return comment; } diff --git a/src/libvaladoc/taglets/tagletdeprecated.vala b/src/libvaladoc/taglets/tagletdeprecated.vala index f51adc174..468f6ec55 100755 --- a/src/libvaladoc/taglets/tagletdeprecated.vala +++ b/src/libvaladoc/taglets/tagletdeprecated.vala @@ -1,6 +1,7 @@ /* tagletdeprecated.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,8 +29,8 @@ public class Valadoc.Taglets.Deprecated : InlineContent, Taglet, Block { return run_rule; } - public override void check (Api.Tree api_root, Api.Node container, ErrorReporter reporter, Settings settings) { - base.check (api_root, container, reporter, settings); + public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { + base.check (api_root, container, file_path, reporter, settings); } public override void accept (ContentVisitor visitor) { diff --git a/src/libvaladoc/taglets/tagletinheritdoc.vala b/src/libvaladoc/taglets/tagletinheritdoc.vala index 329db6869..653a448a1 100755 --- a/src/libvaladoc/taglets/tagletinheritdoc.vala +++ b/src/libvaladoc/taglets/tagletinheritdoc.vala @@ -1,6 +1,7 @@ /* tagletinheritdoc.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -30,7 +31,7 @@ public class Valadoc.Taglets.InheritDoc : InlineTaglet { return null; } - public override void check (Api.Tree api_root, Api.Node container, ErrorReporter reporter, Settings settings) { + public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { // TODO Check that the container is an override of an abstract symbol // Also retrieve that abstract symbol _inherited diff --git a/src/libvaladoc/taglets/tagletlink.vala b/src/libvaladoc/taglets/tagletlink.vala index 3ebb6de3e..cbe8dc499 100755 --- a/src/libvaladoc/taglets/tagletlink.vala +++ b/src/libvaladoc/taglets/tagletlink.vala @@ -1,6 +1,7 @@ /* taglet.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -50,7 +51,7 @@ public class Valadoc.Taglets.Link : InlineTaglet { }); } - public override void check (Api.Tree api_root, Api.Node container, ErrorReporter reporter, Settings settings) { + public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { if (symbol_name.has_prefix ("c::")) { _symbol_name = _symbol_name.substring (3); _symbol = api_root.search_symbol_cstr (container, symbol_name); @@ -75,7 +76,7 @@ public class Valadoc.Taglets.Link : InlineTaglet { reporter.simple_warning ("%s: %s does not exist", container.get_full_name (), symbol_name); } - base.check (api_root, container, reporter, settings); + base.check (api_root, container, file_path, reporter, settings); } public override ContentElement produce_content () { diff --git a/src/libvaladoc/taglets/tagletparam.vala b/src/libvaladoc/taglets/tagletparam.vala index 6dfb235ef..bbff4030b 100755 --- a/src/libvaladoc/taglets/tagletparam.vala +++ b/src/libvaladoc/taglets/tagletparam.vala @@ -1,6 +1,7 @@ /* taglet.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -40,7 +41,7 @@ public class Valadoc.Taglets.Param : InlineContent, Taglet, Block { } - public override void check (Api.Tree api_root, Api.Node container, ErrorReporter reporter, Settings settings) { + public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { // Check for the existence of such a parameter this.parameter = null; @@ -72,7 +73,7 @@ public class Valadoc.Taglets.Param : InlineContent, Taglet, Block { reporter.simple_warning ("%s: Unknown parameter `%s'", container.get_full_name (), parameter_name); } - base.check (api_root, container, reporter, settings); + base.check (api_root, container, file_path, reporter, settings); } public override void accept (ContentVisitor visitor) { diff --git a/src/libvaladoc/taglets/tagletreturn.vala b/src/libvaladoc/taglets/tagletreturn.vala index a4beee0c6..5a2797737 100755 --- a/src/libvaladoc/taglets/tagletreturn.vala +++ b/src/libvaladoc/taglets/tagletreturn.vala @@ -1,6 +1,7 @@ /* taglet.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -29,10 +30,10 @@ public class Valadoc.Taglets.Return : InlineContent, Taglet, Block { return run_rule; } - public override void check (Api.Tree api_root, Api.Node container, ErrorReporter reporter, Settings settings) { + public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { // TODO check for the existence of a return type - base.check (api_root, container, reporter, settings); + base.check (api_root, container, file_path, reporter, settings); } public override void accept (ContentVisitor visitor) { diff --git a/src/libvaladoc/taglets/tagletsee.vala b/src/libvaladoc/taglets/tagletsee.vala index 68ed636ed..895e3c2a2 100755 --- a/src/libvaladoc/taglets/tagletsee.vala +++ b/src/libvaladoc/taglets/tagletsee.vala @@ -1,6 +1,7 @@ /* tagletsee.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -38,7 +39,7 @@ public class Valadoc.Taglets.See : ContentElement, Taglet, Block { }); } - public override void check (Api.Tree api_root, Api.Node container, ErrorReporter reporter, Settings settings) { + public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { if (symbol_name.has_prefix ("c::")) { symbol_name = symbol_name.substring (3); symbol = api_root.search_symbol_cstr (container, symbol_name); diff --git a/src/libvaladoc/taglets/tagletsince.vala b/src/libvaladoc/taglets/tagletsince.vala index 5b68ecfe8..49acafbc0 100755 --- a/src/libvaladoc/taglets/tagletsince.vala +++ b/src/libvaladoc/taglets/tagletsince.vala @@ -1,6 +1,7 @@ /* tagletsince.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -37,7 +38,7 @@ public class Valadoc.Taglets.Since : ContentElement, Taglet, Block { }); } - public override void check (Api.Tree api_root, Api.Node container, ErrorReporter reporter, Settings settings) { + public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { } public override void accept (ContentVisitor visitor) { diff --git a/src/libvaladoc/taglets/tagletthrows.vala b/src/libvaladoc/taglets/tagletthrows.vala index b592f6ca1..547fbc7ca 100755 --- a/src/libvaladoc/taglets/tagletthrows.vala +++ b/src/libvaladoc/taglets/tagletthrows.vala @@ -1,6 +1,7 @@ /* tagletthrows.vala * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois + * Copyright (C) 2008-2009 Didier Villevalois + * Copyright (C) 2008-2012 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -35,14 +36,14 @@ public class Valadoc.Taglets.Throws : InlineContent, Taglet, Block { }); } - public override void check (Api.Tree api_root, Api.Node container, ErrorReporter reporter, Settings settings) { + public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { error_domain = api_root.search_symbol_str (container, error_domain_name); if (error_domain == null) { // TODO use ContentElement's source reference reporter.simple_error ("%s does not exist", error_domain_name); } - base.check (api_root, container, reporter, settings); + base.check (api_root, container, file_path, reporter, settings); } public override void accept (ContentVisitor visitor) {