## Settings:
##
-VALA_REQUIRED=0.13.1.56
+VALA_REQUIRED=0.13.2
LIBGEE_REQUIRED=0.5
LIBGVC_REQUIRED=2.16
GLIB_REQUIRED=2.12.0
//
private bool add_package (Vala.CodeContext context, string pkg) {
+ // ignore multiple occurences of the same package
if (context.has_package (pkg)) {
- // ignore multiple occurences of the same package
return true;
}
+ string vapi_name = pkg + ".vapi";
+ foreach (string source_file in settings.source_files) {
+ if (Path.get_basename (source_file) == vapi_name) {
+ return true;
+ }
+ }
+
var package_path = context.get_package_path (pkg, settings.vapi_directories) ?? context.get_gir_path (pkg, settings.vapi_directories);
if (package_path == null) {
//
private bool add_package (Vala.CodeContext context, string pkg) {
+ // ignore multiple occurences of the same package
if (context.has_package (pkg)) {
- // ignore multiple occurences of the same package
return true;
}
+ string vapi_name = pkg + ".vapi";
+ foreach (string source_file in settings.source_files) {
+ if (Path.get_basename (source_file) == vapi_name) {
+ return true;
+ }
+ }
+
+
var package_path = context.get_vapi_path (pkg) ?? context.get_gir_path (pkg);
if (package_path == null) {
Vala.Report.error (null, "Package `%s' not found in specified Vala API directories or GObject-Introspection GIR directories".printf (pkg));
//
private bool add_package (Vala.CodeContext context, string pkg) {
+ // ignore multiple occurences of the same package
if (context.has_package (pkg)) {
- // ignore multiple occurences of the same package
return true;
}
+ string vapi_name = pkg + ".vapi";
+ foreach (string source_file in settings.source_files) {
+ if (Path.get_basename (source_file) == vapi_name) {
+ return true;
+ }
+ }
+
+
var package_path = context.get_vapi_path (pkg) ?? context.get_gir_path (pkg);
if (package_path == null) {
Vala.Report.error (null, "Package `%s' not found in specified Vala API directories or GObject-Introspection GIR directories".printf (pkg));
//
private bool add_package (Vala.CodeContext context, string pkg) {
+ // ignore multiple occurences of the same package
if (context.has_package (pkg)) {
- // ignore multiple occurences of the same package
return true;
}
+ string vapi_name = pkg + ".vapi";
+ foreach (string source_file in settings.source_files) {
+ if (Path.get_basename (source_file) == vapi_name) {
+ return true;
+ }
+ }
+
+
var package_path = context.get_vapi_path (pkg) ?? context.get_gir_path (pkg);
if (package_path == null) {
Vala.Report.error (null, "Package `%s' not found in specified Vala API directories or GObject-Introspection GIR directories".printf (pkg));
//
private bool add_package (Vala.CodeContext context, string pkg) {
+ // ignore multiple occurences of the same package
if (context.has_package (pkg)) {
- // ignore multiple occurences of the same package
return true;
}
+ string vapi_name = pkg + ".vapi";
+ foreach (string source_file in settings.source_files) {
+ if (Path.get_basename (source_file) == vapi_name) {
+ return true;
+ }
+ }
+
+
var package_path = context.get_vapi_path (pkg) ?? context.get_gir_path (pkg);
if (package_path == null) {
Vala.Report.error (null, "Package `%s' not found in specified Vala API directories or GObject-Introspection GIR directories".printf (pkg));
* @param name a C-name
* @return the resolved node or null
*/
- public Api.Node? resolve_symbol (string name) {
- return nodes.get (name);
+ public Api.Node? resolve_symbol (string _name) {
+ string name = _name.replace ("-", "_");
+
+ Api.Node? node = nodes.get (name);
+ if (node != null) {
+ return node;
+ }
+
+ var name_length = name.length;
+ if (name_length > 5 && name.has_suffix ("Class")) {
+ return nodes.get (name.substring (0, name_length - 5));
+ }
+
+ /*
+ for (int i = 0; name[i] != '\0' ; i++) {
+ if (name[i] == ':' && name[i+1] == ':') {
+ string first_part = name.substring (0, i - 1);
+ string second_part = name.substring (i + 2, -1);
+ string nick = first_part + ":" + second_part;
+ return nodes.get (nick);
+ } else if (name[i] == ':') {
+ string first_part = name.substring (0, i);
+ string second_part = name.substring (i + 1, -1);
+ string nick = first_part + "::" + second_part;
+ return nodes.get (nick);
+ }
+ } */
+
+ return null;
}
private void register_symbol (string? name, Api.Node node) {
if (name != null) {
- nodes.set (name, node);
+ nodes.set (name.replace ("-", "_"), node);
}
}
*/
public override void visit_property (Property item) {
string parent_cname = get_parent_type_cname (item);
- if (parent_cname != null) {
- register_symbol (parent_cname+":"+item.get_cname (), item);
+ assert (parent_cname != null);
+
+ string cname = item.get_cname ();
+ register_symbol (parent_cname+":"+cname, item);
+
+
+ Collection<Interface> interfaces = null;
+ Collection<Class> classes = null;
+
+ if (item.parent is Interface) {
+ interfaces = ((Api.Interface) item.parent).get_known_related_interfaces ();
+ classes = ((Api.Interface) item.parent).get_known_implementations ();
+ } else if (item.parent is Class) {
+ interfaces = ((Api.Class) item.parent).get_known_derived_interfaces ();
+ classes = ((Api.Class) item.parent).get_known_child_classes ();
+ }
+
+ foreach (Interface iface in interfaces) {
+ register_symbol (iface.get_cname () + ":" + cname, item);
+ }
+
+ foreach (Class cl in classes) {
+ register_symbol (cl.get_cname () + ":" + cname, item);
}
}
* {@inheritDoc}
*/
public override void visit_field (Field item) {
- if (item is Namespace) {
+ if (item.parent is Namespace || item.is_static) {
register_symbol (item.get_cname (), item);
} else {
string parent_cname = get_parent_type_cname (item);
*/
public override void visit_signal (Api.Signal item) {
string parent_cname = get_parent_type_cname (item);
- if (parent_cname != null) {
- register_symbol (parent_cname+"::"+item.get_cname (), item);
+ assert (parent_cname != null);
+
+ string cname = item.get_cname ();
+ register_symbol (parent_cname+"::"+cname, item);
+
+
+ Collection<Interface> interfaces = null;
+ Collection<Class> classes = null;
+
+ if (item.parent is Interface) {
+ interfaces = ((Api.Interface) item.parent).get_known_related_interfaces ();
+ classes = ((Api.Interface) item.parent).get_known_implementations ();
+ } else if (item.parent is Class) {
+ interfaces = ((Api.Class) item.parent).get_known_derived_interfaces ();
+ classes = ((Api.Class) item.parent).get_known_child_classes ();
+ }
+
+ foreach (Interface iface in interfaces) {
+ register_symbol (iface.get_cname () + "::" + cname, item);
+ }
+
+ foreach (Class cl in classes) {
+ register_symbol (cl.get_cname () + "::" + cname, item);
}
}
* {@inheritDoc}
*/
public override void visit_method (Method item) {
+ if (item.is_abstract || item.is_virtual || item.is_override) {
+ string parent_cname = get_parent_type_cname (item);
+ register_symbol (parent_cname + "->" + item.name, item);
+
+ Collection<Interface> interfaces = null;
+ Collection<Class> classes = null;
+
+ if (item.parent is Interface) {
+ interfaces = ((Api.Interface) item.parent).get_known_related_interfaces ();
+ classes = ((Api.Interface) item.parent).get_known_implementations ();
+ } else if (item.parent is Class) {
+ interfaces = ((Api.Class) item.parent).get_known_derived_interfaces ();
+ classes = ((Api.Class) item.parent).get_known_child_classes ();
+ }
+
+ foreach (Interface iface in interfaces) {
+ register_symbol (iface.get_cname () + "->" + item.name, item);
+ }
+
+ foreach (Class cl in classes) {
+ register_symbol (cl.get_cname () + "->" + item.name, item);
+ }
+ }
+
register_symbol (item.get_cname (), item);
}
TokenType.BREAK.action ((token) => { add_content_string ("\n"); }),
TokenType.CLOSED_BRACE.action (add_text),
TokenType.MINUS.action (add_text),
+ TokenType.ALIGN_BOTTOM.action (add_text),
TokenType.ALIGN_TOP.action (add_text),
TokenType.GREATER_THAN.action (add_text),
TokenType.LESS_THAN.action (add_text),
Rule comment =
Rule.seq ({
TokenType.EOL,
- description,
+ Rule.option ({
+ description
+ }),
Rule.option ({
Rule.many ({ taglet })
})
protected Html.CssClassResolver cssresolver;
protected Charts.Factory image_factory;
+ protected string package_list_link = "../index.html";
// CSS:
private const string css_inline_navigation = "navi_inline";
Gee.ArrayList<Api.Node> lst = new Gee.ArrayList<Api.Node> ();
Api.Node pos = element;
- this.write_top_element_template ("../index.html");
+ this.write_top_element_template (package_list_link);
while (pos != null) {
lst.add (pos);
public class Valadoc.Html.LinkHelper : Object {
private Settings _settings = null;
+ public bool enable_browsable_check {
+ default = true;
+ get;
+ set;
+ }
+
public string? get_package_link (Api.Package package, Settings settings) {
- if (!package.is_browsable (settings)) {
+ if (enable_browsable_check && !package.is_browsable (settings)) {
return null;
}
protected virtual string? from_package_to_package (Api.Package from, Api.Package to) {
- if (!to.is_browsable(_settings)) {
+ if (enable_browsable_check && !to.is_browsable(_settings)) {
return null;
}
}
protected virtual string? from_package_to_node (Api.Package from, Api.Node to) {
- if (!to.is_browsable(_settings) || !to.package.is_browsable (_settings)) {
+ if (enable_browsable_check && (!to.is_browsable(_settings) || !to.package.is_browsable (_settings))) {
return null;
}
protected virtual string? from_wiki_to_package (WikiPage from, Api.Package to) {
- if (!to.is_browsable(_settings)) {
+ if (enable_browsable_check && !to.is_browsable(_settings)) {
return null;
}
}
protected virtual string? from_wiki_to_node (WikiPage from, Api.Node to) {
- if (!to.is_browsable(_settings) || !to.package.is_browsable (_settings)) {
+ if (enable_browsable_check && (!to.is_browsable(_settings) || !to.package.is_browsable (_settings))) {
return null;
}
protected virtual string? from_node_to_package (Api.Node from, Api.Package to) {
- if (!to.is_browsable (_settings)) {
+ if (enable_browsable_check && !to.is_browsable (_settings)) {
return null;
}
}
protected virtual string? from_node_to_node (Api.Node from, Api.Node to) {
- if (!to.is_browsable(_settings) || !to.package.is_browsable (_settings)) {
+ if (enable_browsable_check && (!to.is_browsable(_settings) || !to.package.is_browsable (_settings))) {
return null;
}
}
if (symbol == null) {
- reporter.simple_warning ("%s does not exist", symbol_name);
+ if (settings.verbose) {
+ reporter.simple_warning ("Node %s does not exist", symbol_name);
+ }
+
return ;
}
private ErrorReporter reporter;
+ public MarkupReader.from_string (string filename, string content, ErrorReporter reporter) {
+ this.filename = filename;
+ this.reporter = reporter;
+
+ begin = content;
+ end = begin + content.size ();
+ current = begin;
+
+ column = 1;
+ line = 1;
+ }
+
public MarkupReader (string filename, ErrorReporter reporter) {
this.filename = filename;
this.reporter = reporter;
content.append_c ('>');
current += 4;
text_begin = current;
+ } else if (((string) next_pos).has_prefix ("percnt;")) {
+ content.append (((string) text_begin).substring (0, (int) (current - text_begin)));
+ content.append_c ('>');
+ current += 8;
+ text_begin = current;
} else {
current += u.to_utf8 (null);
}
public enum Valadoc.MarkupTokenType {
NONE,
+ COMMENT,
START_ELEMENT,
END_ELEMENT,
TEXT,
public override Rule? get_parser_rule (Rule run_rule) {
return Rule.seq ({
Rule.option ({ Rule.many ({ TokenType.SPACE }) }),
- TokenType.any_word ().action ((token) => { symbol_name = token.to_string (); })
+ TokenType.any_word ().action ((token) => { symbol_name = token.to_string (); }),
+ Rule.option ({
+ Rule.many ({
+ Rule.one_of ({
+ TokenType.any_word ().action ((token) => { symbol_name += token.to_string (); }),
+ TokenType.MINUS.action ((token => { symbol_name += token.to_string (); }))
+ })
+ })
+ })
});
}
if (_symbol == null) {
// TODO use ContentElement's source reference
- reporter.simple_warning ("%s does not exist", symbol_name);
+ reporter.simple_warning ("%s: %s does not exist", container.get_full_name (), symbol_name);
}
base.check (api_root, container, reporter, settings);