}
private string get_real_path (Api.Node element) {
- return GLib.Path.build_filename (this.settings.path, this.package_dir_name, element.get_full_name () + ".html");
+ return GLib.Path.build_filename (this.settings.path,
+ this.package_dir_name, element.get_full_name () + ".html");
}
protected override string get_icon_directory () {
public override void process (Settings settings, Api.Tree tree, ErrorReporter reporter) {
base.process (settings, tree, reporter);
DirUtils.create_with_parents (this.settings.path, 0777);
- write_wiki_pages (tree, css_path_wiki, js_path_wiki, Path.build_filename (this.settings.path, this.settings.pkg_name));
+ write_wiki_pages (tree,
+ css_path_wiki,
+ js_path_wiki,
+ Path.build_filename (this.settings.path, this.settings.pkg_name));
tree.accept (this);
}
var devfile = FileStream.open (devpath, "w");
_devhelpwriter = new Devhelp.MarkupWriter (devfile);
- _devhelpwriter.start_book (pkg_name+" Reference Manual", "vala", "index.htm", pkg_name, "", "");
-
+ _devhelpwriter.start_book (pkg_name+" Reference Manual",
+ "vala",
+ "index.htm",
+ pkg_name,
+ "",
+ "");
GLib.FileStream file = GLib.FileStream.open (filepath, "w");
writer = new Html.MarkupWriter (file);
typekeyword = "struct";
}
- _devhelpwriter.simple_tag ("keyword", {"type", typekeyword, "name", node.name, "link", get_link (node, node.package)});
+ _devhelpwriter.simple_tag ("keyword", {"type", typekeyword,
+ "name", node.name,
+ "link", get_link (node, node.package)});
}
_devhelpwriter.end_functions ();
GLib.FileStream file = GLib.FileStream.open (rpath, "w");
writer = new Html.MarkupWriter (file);
_renderer.set_writer (writer);
- write_file_header (css_path, js_path, node.get_full_name () + " – " + node.package.name);
+ write_file_header (css_path,
+ js_path,
+ node.get_full_name () + " – " + node.package.name);
write_symbol_content (node);
write_file_footer ();
file = null;
GLib.FileStream file = GLib.FileStream.open (rpath, "w");
writer = new Html.MarkupWriter (file);
_renderer.set_writer (writer);
- write_file_header (css_path, js_path, node.get_full_name() + " – " + node.package.name);
+ write_file_header (css_path,
+ js_path,
+ node.get_full_name() + " – " + node.package.name);
write_symbol_content (node);
write_file_footer ();
file = null;
current_builder.append_printf ("<title>%s</title>", em.caption);
}
- current_builder.append_printf ("<mediaobject><imageobject><imagedata fileref=\"%s\"/></imageobject>", em.url);
+ current_builder.append_printf ("<mediaobject><imageobject><imagedata fileref=\"%s\"/></imageobject>",
+ em.url);
if (em.caption != null) {
current_builder.append_printf ("<textobject><phrase>%s</phrase></textobject>", em.caption);
break;
default:
- reporter.simple_warning ("GtkDoc: warning: unsupported list type: %s", list.bullet.to_string ());
+ reporter.simple_warning ("GtkDoc: warning: unsupported list type: %s",
+ list.bullet.to_string ());
break;
}
} else if (t is Taglets.Throws) {
var taglet = (Taglets.Throws) t;
var link = get_docbook_link (taglet.error_domain) ?? taglet.error_domain_name;
- old_builder.append_printf ("\n<para>%s will be returned in @error %s</para>", link, current_builder.str);
+ old_builder.append_printf ("\n<para>%s will be returned in @error %s</para>",
+ link,
+ current_builder.str);
} else {
reporter.simple_warning ("GtkDoc: warning: Taglet not supported"); // TODO
}
if (direction == Direction.NONE) {
return """<parameter><type>'%s'</type> %s</parameter>""".printf (signature, name);
} else {
- return """<parameter>%s <type>'%s'</type> %s</parameter>""".printf (direction.to_string(), signature, name);
+ return """<parameter>%s <type>'%s'</type> %s</parameter>""".printf (direction.to_string(),
+ signature,
+ name);
}
}
}
if (link) {
builder.append_printf ("""
-<link linkend="%s-%s">%s</link>%s(""", iface.get_docbook_id (), get_docbook_id (), name, string.nfill (indent-name.length, ' '));
+<link linkend="%s-%s">%s</link>%s(""",
+ iface.get_docbook_id (),
+ get_docbook_id (),
+ name,
+ string.nfill (indent-name.length, ' '));
} else {
- builder.append_printf ("\n%s%s(", name, string.nfill (indent-name.length, ' '));
+ builder.append_printf ("\n%s%s(",
+ name,
+ string.nfill (indent-name.length, ' '));
}
if (parameters.size > 0) {
public Gee.List<Member> methods = new Gee.LinkedList<Member>();
public Gee.List<Member> signals = new Gee.LinkedList<Member>();
- public Interface (string package_name, string name, string purpose = "", string description = "") {
+ public Interface (string package_name,
+ string name,
+ string purpose = "",
+ string description = "")
+ {
this.package_name = package_name;
this.name = name;
this.purpose = purpose;
var xml_dir = Path.build_filename (settings.path, "xml");
DirUtils.create_with_parents (xml_dir, 0777);
- var xml_file = Path.build_filename (xml_dir, "%s.xml".printf (to_docbook_id (name)));
+ var xml_file = Path.build_filename (xml_dir,
+ "%s.xml".printf (to_docbook_id (name)));
var writer = new TextWriter (xml_file, "w");
if (!writer.open ()) {
- reporter.simple_error ("GtkDoc: error: unable to open %s for writing", writer.filename);
+ reporter.simple_error ("GtkDoc: error: unable to open %s for writing",
+ writer.filename);
return false;
}
writer.write_line (to_string (reporter));
<refnamediv>
<refname>%s</refname>
<refpurpose>%s</refpurpose>
-</refnamediv>""", docbook_id, docbook_id, name, package_name.up (), name, purpose ?? "");
+</refnamediv>""",
+ docbook_id,
+ docbook_id,
+ name,
+ package_name.up (),
+ name,
+ purpose ?? "");
/*
* Methods
<programlisting>%s
</programlisting>
%s
-</refsect2>""", docbook_id, method.get_docbook_id (), method.name, method.to_string (method_indent, false), method.comment != null ? method.comment.to_docbook (reporter) : "");
+</refsect2>""",
+ docbook_id,
+ method.get_docbook_id (),
+ method.name,
+ method.to_string (method_indent, false),
+ method.comment != null ? method.comment.to_docbook (reporter) : "");
}
builder.append ("</refsect1>");
<programlisting>%s
</programlisting>
%s
-</refsect2>""", docbook_id, sig.get_docbook_id (), sig.name, sig.to_string (signal_indent, false), sig.comment != null ? sig.comment.to_docbook (reporter) : "");
+</refsect2>""",
+ docbook_id,
+ sig.get_docbook_id (),
+ sig.name,
+ sig.to_string (signal_indent, false),
+ sig.comment != null ? sig.comment.to_docbook (reporter) : "");
}
builder.append ("</refsect1>");
} else if (filename.has_suffix (".h")) {
prepare_h_file (filename);
} else {
- reporter.simple_error ("GtkDoc: error: %s is not a supported source file type. Only .h, and .c files are supported.", relative_filename);
+ reporter.simple_error ("GtkDoc: error: %s is not a supported source file type. Only .h, and .c files are supported.",
+ relative_filename);
}
}
try {
FileUtils.get_contents (main_file, out contents);
} catch (Error e) {
- reporter.simple_error ("GtkDoc: error: Error while reading main file '%s' contents: %s", main_file, e.message);
+ reporter.simple_error ("GtkDoc: error: Error while reading main file '%s' contents: %s",
+ main_file, e.message);
return false;
}
// hackish but prevents us from re-creating the whole main file,
// which would more even more hackish
var builder = new StringBuilder ();
- builder.append_printf ("\n<chapter>\n<title>%s D-Bus API Reference</title>\n", settings.pkg_name);
+ builder.append_printf ("\n<chapter>\n<title>%s D-Bus API Reference</title>\n",
+ settings.pkg_name);
foreach (var iface in generator.dbus_interfaces) {
- builder.append_printf ("<xi:include href=\"xml/%s.xml\"/>\n", to_docbook_id (iface.name));
+ builder.append_printf ("<xi:include href=\"xml/%s.xml\"/>\n",
+ to_docbook_id (iface.name));
}
- var hierarchy_file = Path.build_filename (settings.path, "%s.hierarchy".printf (settings.pkg_name));
+ var hierarchy_file = Path.build_filename (settings.path, "%s.hierarchy"
+ .printf (settings.pkg_name));
if (FileUtils.test (hierarchy_file, FileTest.EXISTS)) {
// if hierarchy exists, gtkdoc-mkdb will output it
builder.append ("</chapter>\n<chapter id=\"object-tree\">");
try {
FileUtils.set_contents (main_file, contents);
} catch (Error e) {
- reporter.simple_error ("GtkDoc: error: Error while writing main file '%s' contents: %s", main_file, e.message);
+ reporter.simple_error ("GtkDoc: error: Error while writing main file '%s' contents: %s",
+ main_file, e.message);
return false;
}
}
return file_data;
}
- private Gee.List<Header> merge_headers (Gee.List<Header> doc_headers, Gee.List<Header>? lang_headers) {
+ private Gee.List<Header> merge_headers (Gee.List<Header> doc_headers,
+ Gee.List<Header>? lang_headers)
+ {
if (lang_headers == null) {
return doc_headers;
}
return headers;
}
- private void set_section_comment (string filename, string section_name, Content.Comment? comment, string symbol_full_name) {
+ private void set_section_comment (string filename,
+ string section_name,
+ Content.Comment? comment,
+ string symbol_full_name)
+ {
var file_data = get_file_data (filename);
if (file_data.title == null) {
file_data.title = section_name;
* forward that as a Valadoc warning so that it doesn’t get lost
* in the gtk-doc output files. */
if (gcomment.long_comment == null || gcomment.long_comment == "") {
- reporter.simple_warning ("Missing long description in the documentation for ‘%s’ which forms gtk-doc section ‘%s’.", symbol_full_name, section_name);
+ reporter.simple_warning ("Missing long description in the documentation for ‘%s’ which forms gtk-doc section ‘%s’.",
+ symbol_full_name,
+ section_name);
}
}
- private GComment create_gcomment (string symbol, Content.Comment? comment, string[]? returns_annotations = null, bool is_dbus = false) {
+ private GComment create_gcomment (string symbol,
+ Content.Comment? comment,
+ string[]? returns_annotations = null,
+ bool is_dbus = false)
+ {
var converter = new Gtkdoc.CommentConverter (reporter, current_method_or_delegate);
if (comment != null) {
return gcomment;
}
- private GComment add_symbol (string filename, string cname, Content.Comment? comment = null, string? symbol = null, string[]? returns_annotations = null) {
+ private GComment add_symbol (string filename,
+ string cname,
+ Content.Comment? comment = null,
+ string? symbol = null,
+ string[]? returns_annotations = null)
+ {
var file_data = get_file_data (filename);
file_data.register_section_line (cname);
return gcomment;
}
- private Header? add_custom_header (string name, string? comment, string[]? annotations = null, double pos = double.MAX, bool block = true) {
+ private Header? add_custom_header (string name,
+ string? comment,
+ string[]? annotations = null,
+ double pos = double.MAX,
+ bool block = true)
+ {
if (comment == null && annotations == null) {
return null;
}
return null;
}
- private Header? add_header (string name, Content.Comment? comment, string[]? annotations = null, double pos = double.MAX) {
+ private Header? add_header (string name,
+ Content.Comment? comment,
+ string[]? annotations = null,
+ double pos = double.MAX)
+ {
if (comment == null && annotations == null) {
return null;
}
public override void visit_namespace (Api.Namespace ns) {
if (ns.get_filename () != null && ns.documentation != null) {
- set_section_comment (ns.get_filename (), get_section (ns.get_filename ()), ns.documentation, ns.get_full_name ());
+ set_section_comment (ns.get_filename (),
+ get_section (ns.get_filename ()),
+ ns.documentation,
+ ns.get_full_name ());
}
ns.accept_all_children (this);
iface.accept_all_children (this);
var gcomment = add_symbol (iface.get_filename(), iface.get_cname(), iface.documentation, null);
- set_section_comment (iface.get_filename(), iface.get_cname(), iface.documentation, iface.get_full_name ());
+ set_section_comment (iface.get_filename(),
+ iface.get_cname(),
+ iface.documentation,
+ iface.get_full_name ());
if (current_dbus_interface != null) {
current_dbus_interface.write (settings, reporter);
foreach (Api.Node _type in type_parameters) {
var type = _type as Api.TypeParameter;
string type_name_down = type.name.down ();
- add_custom_header ("get_%s_type".printf (type_name_down), "The #GType for %s".printf (type_name_down));
- add_custom_header ("get_%s_dup_func".printf (type_name_down), "A dup function for #%sIface.get_%s_type()".printf (iface.get_cname (), type_name_down));
- add_custom_header ("get_%s_destroy_func".printf (type_name_down), "A destroy function for #%sIface.get_%s_type()".printf (iface.get_cname (), type_name_down));
+ add_custom_header ("get_%s_type".printf (type_name_down),
+ "The #GType for %s".printf (type_name_down));
+ add_custom_header ("get_%s_dup_func".printf (type_name_down),
+ "A dup function for #%sIface.get_%s_type()".printf (iface.get_cname (), type_name_down));
+ add_custom_header ("get_%s_destroy_func".printf (type_name_down),
+ "A destroy function for #%sIface.get_%s_type()".printf (iface.get_cname (), type_name_down));
}
}
gcomment = add_symbol (iface.get_filename (), iface.get_cname () + "Iface");
add_custom_header ("name", "canonical name of the property specified");
add_custom_header ("nick", "nick name for the property specified");
add_custom_header ("blurb", "description of the property specified");
- add_custom_header ("object_type", "%s derived type of this property".printf (get_docbook_type_link (cl)));
+ add_custom_header ("object_type", "%s derived type of this property"
+ .printf (get_docbook_type_link (cl)));
add_custom_header ("flags", "flags for the property specified");
gcomment = add_symbol (filename, cl.get_param_spec_function_cname ());
- gcomment.brief_comment = "Creates a new <link linkend=\"GParamSpecBoxed\"><type>GParamSpecBoxed</type></link> instance specifying a %s derived property.".printf (get_docbook_type_link (cl));
+ gcomment.brief_comment = "Creates a new <link linkend=\"GParamSpecBoxed\"><type>GParamSpecBoxed</type></link> instance specifying a %s derived property."
+ .printf (get_docbook_type_link (cl));
gcomment.long_comment = "See <link linkend=\"g-param-spec-internal\"><function>g_param_spec_internal()</function></link> for details on property names.";
// value_set
current_headers.clear ();
- add_custom_header ("value", "a valid <link linkend=\"GValue\"><type>GValue</type></link> of %s derived type".printf (get_docbook_type_link (cl)));
+ add_custom_header ("value", "a valid <link linkend=\"GValue\"><type>GValue</type></link> of %s derived type"
+ .printf (get_docbook_type_link (cl)));
add_custom_header ("v_object", "object value to be set");
gcomment = add_symbol (filename, cl.get_set_value_function_cname ());
- gcomment.brief_comment = "Set the contents of a %s derived <link linkend=\"GValue\"><type>GValue</type></link> to @v_object.".printf (get_docbook_type_link (cl));
+ gcomment.brief_comment = "Set the contents of a %s derived <link linkend=\"GValue\"><type>GValue</type></link> to @v_object."
+ .printf (get_docbook_type_link (cl));
gcomment.long_comment = "<link linkend=\"%s\"><function>%s()</function></link> increases the reference count of @v_object (the <link linkend=\"GValue\"><type>GValue</type></link> holds a reference to @v_object). If you do not wish to increase the reference count of the object (i.e. you wish to pass your current reference to the <link linkend=\"GValue\"><type>GValue</type></link> because you no longer need it), use <link linkend=\"%s\"><function>%s()</function></link> instead.
-It is important that your <link linkend=\"GValue\"><type>GValue</type></link> holds a reference to @v_object (either its own, or one it has taken) to ensure that the object won't be destroyed while the <link linkend=\"GValue\"><type>GValue</type></link> still exists).".printf (to_docbook_id (cl.get_set_value_function_cname ()), cl.get_set_value_function_cname (), to_docbook_id (cl.get_take_value_function_cname ()), cl.get_take_value_function_cname ());
+It is important that your <link linkend=\"GValue\"><type>GValue</type></link> holds a reference to @v_object (either its own, or one it has taken) to ensure that the object won't be destroyed while the <link linkend=\"GValue\"><type>GValue</type></link> still exists)."
+ .printf (to_docbook_id (cl.get_set_value_function_cname ()),
+ cl.get_set_value_function_cname (),
+ to_docbook_id (cl.get_take_value_function_cname ()),
+ cl.get_take_value_function_cname ());
// value_get
current_headers.clear ();
- add_custom_header ("value", "a valid <link linkend=\"GValue\"><type>GValue</type></link> of %s derived type".printf (get_docbook_type_link (cl)));
+ add_custom_header ("value", "a valid <link linkend=\"GValue\"><type>GValue</type></link> of %s derived type"
+ .printf (get_docbook_type_link (cl)));
gcomment = add_symbol (filename, cl.get_get_value_function_cname ());
- gcomment.brief_comment = "Get the contents of a %s derived <link linkend=\"GValue\"><type>GValue</type></link>.".printf (get_docbook_type_link (cl));
+ gcomment.brief_comment = "Get the contents of a %s derived <link linkend=\"GValue\"><type>GValue</type></link>."
+ .printf (get_docbook_type_link (cl));
gcomment.returns = "object contents of @value";
// value_take
current_headers.clear ();
- add_custom_header ("value", "a valid <link linkend=\"GValue\"><type>GValue</type></link> of %s derived type".printf (get_docbook_type_link (cl)));
+ add_custom_header ("value", "a valid <link linkend=\"GValue\"><type>GValue</type></link> of %s derived type"
+ .printf (get_docbook_type_link (cl)));
add_custom_header ("v_object", "object value to be set");
gcomment = add_symbol (filename, cl.get_take_value_function_cname ());
- gcomment.brief_comment = "Sets the contents of a %s derived <link linkend=\"GValue\"><type>GValue</type></link> to @v_object and takes over the ownership of the callers reference to @v_object; the caller doesn't have to unref it any more (i.e. the reference count of the object is not increased).".printf (get_docbook_type_link (cl));
- gcomment.long_comment = "If you want the GValue to hold its own reference to @v_object, use <link linkend=\"%s\"><function>%s()</function></link> instead.".printf (to_docbook_id (cl.get_set_value_function_cname ()), cl.get_set_value_function_cname ());
+ gcomment.brief_comment = "Sets the contents of a %s derived <link linkend=\"GValue\"><type>GValue</type></link> to @v_object and takes over the ownership of the callers reference to @v_object; the caller doesn't have to unref it any more (i.e. the reference count of the object is not increased)."
+ .printf (get_docbook_type_link (cl));
+ gcomment.long_comment = "If you want the GValue to hold its own reference to @v_object, use <link linkend=\"%s\"><function>%s()</function></link> instead."
+ .printf (to_docbook_id (cl.get_set_value_function_cname ()), cl.get_set_value_function_cname ());
}
// Class struct
add_custom_header ("parent_class", "the parent class structure");
gcomment = add_symbol (cl.get_filename (), cl.get_cname () + "Class");
- gcomment.brief_comment = "The class structure for %s. All the fields in this structure are private and should never be accessed directly.".printf (get_docbook_type_link (cl));
+ gcomment.brief_comment = "The class structure for %s. All the fields in this structure are private and should never be accessed directly."
+ .printf (get_docbook_type_link (cl));
// Standard/Private symbols
var file_data = get_file_data (cl.get_filename ());
file_data.register_standard_section_line (cl.get_type_function_name ());
file_data.register_private_section_line (cl.get_private_cname ());
- file_data.register_private_section_line (((cl.nspace.name != null)? cl.nspace.name.down () + "_" : "") + to_lower_case (cl.name) + "_construct");
+ file_data.register_private_section_line (((cl.nspace.name != null)? cl.nspace.name.down () + "_" : "")
+ + to_lower_case (cl.name)
+ + "_construct");
current_cname = old_cname;
current_headers = old_headers;
string? destroy_function_cname = st.get_destroy_function_cname ();
if (dup_function_cname != null) {
var dup_gcomment = add_symbol (st.get_filename (), dup_function_cname);
- dup_gcomment.headers.add (new Header ("self", "the instance to duplicate"));
+ dup_gcomment.headers.add (new Header ("self",
+ "the instance to duplicate"));
if (free_function_cname != null) {
- dup_gcomment.returns = "a copy of @self, free with %s()".printf (free_function_cname);
+ dup_gcomment.returns = "a copy of @self, free with %s()"
+ .printf (free_function_cname);
} else {
dup_gcomment.returns = "a copy of @self";
}
dup_gcomment.brief_comment = "Creates a copy of self.";
- dup_gcomment.see_also = create_see_function_array ({copy_function_cname, destroy_function_cname, free_function_cname});
+ dup_gcomment.see_also = create_see_function_array ({copy_function_cname,
+ destroy_function_cname,
+ free_function_cname});
}
if (free_function_cname != null) {
var free_gcomment = add_symbol (st.get_filename (), free_function_cname);
free_gcomment.headers.add (new Header ("self", "the struct to free"));
free_gcomment.brief_comment = "Frees the heap-allocated struct.";
- free_gcomment.see_also = create_see_function_array ({dup_function_cname, copy_function_cname, destroy_function_cname});
+ free_gcomment.see_also = create_see_function_array ({dup_function_cname,
+ copy_function_cname,
+ destroy_function_cname});
}
if (copy_function_cname != null) {
var copy_gcomment = add_symbol (st.get_filename (), copy_function_cname);
- copy_gcomment.headers.add (new Header ("self", "the struct to copy"));
+ copy_gcomment.headers.add (new Header ("self",
+ "the struct to copy"));
if (destroy_function_cname != null) {
- copy_gcomment.headers.add (new Header ("dest", "a unused struct. Use %s() to free the content.".printf (destroy_function_cname)));
+ copy_gcomment.headers.add (new Header ("dest",
+ "a unused struct. Use %s() to free the content."
+ .printf (destroy_function_cname)));
} else {
- copy_gcomment.headers.add (new Header ("dest", "a unused struct."));
+ copy_gcomment.headers.add (new Header ("dest",
+ "a unused struct."));
}
copy_gcomment.brief_comment = "Creates a copy of self.";
- copy_gcomment.see_also = create_see_function_array ({dup_function_cname, destroy_function_cname, free_function_cname});
+ copy_gcomment.see_also = create_see_function_array ({dup_function_cname,
+ destroy_function_cname,
+ free_function_cname});
}
if (destroy_function_cname != null) {
var destroy_gcomment = add_symbol (st.get_filename (), destroy_function_cname);
destroy_gcomment.headers.add (new Header ("self", "the struct to destroy"));
destroy_gcomment.brief_comment = "Frees the content of the struct pointed by @self.";
- destroy_gcomment.see_also = create_see_function_array ({dup_function_cname, copy_function_cname, free_function_cname});
+ destroy_gcomment.see_also = create_see_function_array ({dup_function_cname,
+ copy_function_cname,
+ free_function_cname});
}
}
var edomain = error as Api.ErrorDomain;
if (edomain != null) {
if (param_header == null) {
- add_custom_header ("error", "location to store the error occuring, or %NULL to ignore", {"error-domains %s".printf (edomain.get_cname ())}, double.MAX-1);
+ add_custom_header ("error",
+ "location to store the error occuring, or %NULL to ignore",
+ {"error-domains %s".printf (edomain.get_cname ())},
+ double.MAX-1);
} else {
// assume the only annotation is error-domains
var annotation = param_header.annotations[0];
param_header.annotations[0] = annotation;
}
} else if (param_header == null) {
- add_custom_header ("error", "location to store the error occuring, or %NULL to ignore", null, double.MAX-1);
+ add_custom_header ("error",
+ "location to store the error occuring, or %NULL to ignore",
+ null,
+ double.MAX - 1);
}
}
current_headers = new Gee.LinkedList<Header>();
edomain.accept_all_children (this);
- var gcomment = add_symbol (edomain.get_filename(), edomain.get_cname(), edomain.documentation);
+ var gcomment = add_symbol (edomain.get_filename(),
+ edomain.get_cname(),
+ edomain.documentation);
// Handle attributes for things like deprecation.
process_attributes (edomain, gcomment);
}
public override void visit_property (Api.Property prop) {
- if (prop.is_override || prop.is_private || (!prop.is_abstract && !prop.is_virtual && prop.base_property != null)) {
+ if (prop.is_override
+ || prop.is_private
+ || (!prop.is_abstract && !prop.is_virtual && prop.base_property != null))
+ {
return;
}
- var gcomment = add_comment (prop.get_filename(), "%s:%s".printf (current_cname, prop.get_cname ()), prop.documentation);
+ var gcomment = add_comment (prop.get_filename(), "%s:%s"
+ .printf (current_cname, prop.get_cname ()), prop.documentation);
prop.accept_all_children (this);
Api.TypeParameter type_parameter = prop.property_type.data_type as Api.TypeParameter;
if (type_parameter != null) {
if (type_parameter.parent is Api.Class) {
return_type_link = "#%s:%s-type".printf (get_cname (prop.parent), type_parameter.name.down ());
- } else if (type_parameter.parent is Api.Interface && ((Api.Symbol) type_parameter.parent).get_attribute ("GenericAccessors") != null) {
- return_type_link = "#_%sIface.get_%s_type()".printf (get_cname (type_parameter.parent), type_parameter.name.down ());
+ } else if (type_parameter.parent is Api.Interface
+ && ((Api.Symbol) type_parameter.parent).get_attribute ("GenericAccessors") != null)
+ {
+ return_type_link = "#_%sIface.get_%s_type()"
+ .printf (get_cname (type_parameter.parent), type_parameter.name.down ());
}
}
if (prop.getter != null && !prop.getter.is_private && prop.getter.is_get) {
var getter_gcomment = add_symbol (prop.get_filename(), prop.getter.get_cname ());
- getter_gcomment.headers.add (new Header ("self", "the %s instance to query".printf (get_docbook_link (prop.parent)), 1));
- getter_gcomment.returns = "the value of the %s property".printf (get_docbook_link (prop));
+ getter_gcomment.headers.add (new Header ("self",
+ "the %s instance to query".printf (get_docbook_link (prop.parent)), 1));
+ getter_gcomment.returns = "the value of the %s property"
+ .printf (get_docbook_link (prop));
if (return_type_link != null) {
getter_gcomment.returns += " of type " + return_type_link;
}
- getter_gcomment.brief_comment = "Get and return the current value of the %s property.".printf (get_docbook_link (prop));
- getter_gcomment.long_comment = combine_comments (gcomment.brief_comment, gcomment.long_comment);
+ getter_gcomment.brief_comment = "Get and return the current value of the %s property."
+ .printf (get_docbook_link (prop));
+ getter_gcomment.long_comment = combine_comments (gcomment.brief_comment,
+ gcomment.long_comment);
if (prop.property_type != null && prop.property_type.data_type is Api.Array) {
var array_type = prop.property_type.data_type;
- for (uint dim = 1; array_type != null && array_type is Api.Array; dim++, array_type = ((Api.Array) array_type).data_type) {
- gcomment.headers.add (new Header ("result_length%u".printf (dim), "return location for the length of the property's value"));
+ for (uint dim = 1; array_type != null && array_type is Api.Array;
+ dim++, array_type = ((Api.Array) array_type).data_type)
+ {
+ gcomment.headers.add (new Header ("result_length%u".printf (dim),
+ "return location for the length of the property's value"));
}
}
if (prop.setter != null && !prop.setter.is_private && prop.setter.is_set) {
var setter_gcomment = add_symbol (prop.get_filename(), prop.setter.get_cname ());
- setter_gcomment.headers.add (new Header ("self", "the %s instance to modify".printf (get_docbook_link (prop.parent)), 1));
+ setter_gcomment.headers.add (new Header ("self", "the %s instance to modify"
+ .printf (get_docbook_link (prop.parent)), 1));
string type_desc = (return_type_link != null)? " of type " + return_type_link : "";
- setter_gcomment.headers.add (new Header ("value", "the new value of the %s property%s".printf (get_docbook_link (prop), type_desc), 2));
- setter_gcomment.brief_comment = "Set the value of the %s property to @value.".printf (get_docbook_link (prop));
- setter_gcomment.long_comment = combine_comments (gcomment.brief_comment, gcomment.long_comment);
+ setter_gcomment.headers.add (new Header ("value", "the new value of the %s property%s"
+ .printf (get_docbook_link (prop), type_desc), 2));
+ setter_gcomment.brief_comment = "Set the value of the %s property to @value."
+ .printf (get_docbook_link (prop));
+ setter_gcomment.long_comment = combine_comments (gcomment.brief_comment,
+ gcomment.long_comment);
if (prop.property_type != null && prop.property_type.data_type is Api.Array) {
var array_type = prop.property_type.data_type;
- for (uint dim = 1; array_type != null && array_type is Api.Array; dim++, array_type = ((Api.Array) array_type).data_type) {
- gcomment.headers.add (new Header ("value_length%u".printf (dim), "length of the property's new value"));
+ for (uint dim = 1; array_type != null && array_type is Api.Array;
+ dim++, array_type = ((Api.Array) array_type).data_type)
+ {
+ gcomment.headers.add (new Header ("value_length%u".printf (dim),
+ "length of the property's new value"));
}
}
}
if (return_type_link != null) {
- string return_type_desc = "<para>Holds a value from type #%s:%s-type.</para>".printf (get_cname (prop.parent), type_parameter.name.down ());
+ string return_type_desc = "<para>Holds a value from type #%s:%s-type.</para>"
+ .printf (get_cname (prop.parent), type_parameter.name.down ());
gcomment.long_comment = combine_inline_docs (return_type_desc, gcomment.long_comment);
}
}
Api.TypeParameter type_parameter = d.return_type.data_type as Api.TypeParameter;
if (type_parameter != null) {
if (type_parameter.parent is Api.Class) {
- string return_type_desc = "A value from type #%s:%s-type.".printf (get_cname (d.parent), type_parameter.name.down ());
+ string return_type_desc = "A value from type #%s:%s-type."
+ .printf (get_cname (d.parent), type_parameter.name.down ());
gcomment.returns = combine_inline_docs (return_type_desc, gcomment.returns);
- } else if (type_parameter.parent is Api.Interface && ((Api.Symbol) type_parameter.parent).get_attribute ("GenericAccessors") != null) {
- string return_type_desc = "A value from type #_%sIface.get_%s_type().".printf (get_cname (d.parent), type_parameter.name.down ());
+ } else if (type_parameter.parent is Api.Interface
+ && ((Api.Symbol) type_parameter.parent).get_attribute ("GenericAccessors") != null)
+ {
+ string return_type_desc = "A value from type #_%sIface.get_%s_type()."
+ .printf (get_cname (d.parent), type_parameter.name.down ());
gcomment.returns = combine_inline_docs (return_type_desc, gcomment.returns);
/*
} else if (type_parameter.parent is Api.Struct) {
var gcomment = add_comment (sig.get_filename(), "%s::%s".printf (current_cname, name), sig.documentation);
// gtkdoc maps parameters by their ordering, so let's customly add the first parameter
gcomment.headers.insert (0, new Header (to_lower_case (((Api.Node)sig.parent).name),
- "the %s instance that received the signal".printf (get_docbook_link (sig.parent)), 0.1));
+ "the %s instance that received the signal".printf (get_docbook_link (sig.parent)),
+ 0.1));
if (current_dbus_interface != null && sig.is_dbus_visible) {
var dbuscomment = create_gcomment (sig.get_dbus_name (), sig.documentation, null, true);
current_dbus_member.comment = dbuscomment;
Api.TypeParameter type_parameter = sig.return_type.data_type as Api.TypeParameter;
if (type_parameter != null) {
if (type_parameter.parent is Api.Class) {
- string return_type_desc = "A value from type #%s:%s-type.".printf (get_cname (type_parameter.parent), type_parameter.name.down ());
- gcomment.returns = combine_inline_docs (return_type_desc, gcomment.returns);
- } else if (type_parameter.parent is Api.Interface && ((Api.Symbol) type_parameter.parent).get_attribute ("GenericAccessors") != null) {
- string return_type_desc = "A value from type #_%sIface.get_%s_type().".printf (get_cname (type_parameter.parent), type_parameter.name.down ());
- gcomment.returns = combine_inline_docs (return_type_desc, gcomment.returns);
+ string return_type_desc = "A value from type #%s:%s-type."
+ .printf (get_cname (type_parameter.parent), type_parameter.name.down ());
+ gcomment.returns = combine_inline_docs (return_type_desc,
+ gcomment.returns);
+ } else if (type_parameter.parent is Api.Interface
+ && ((Api.Symbol) type_parameter.parent).get_attribute ("GenericAccessors") != null)
+ {
+ string return_type_desc = "A value from type #_%sIface.get_%s_type()."
+ .printf (get_cname (type_parameter.parent), type_parameter.name.down ());
+ gcomment.returns = combine_inline_docs (return_type_desc,
+ gcomment.returns);
}
}
}
public override void visit_method (Api.Method m) {
- if ((m.is_constructor && current_class != null && current_class.is_abstract) || m.is_override || m.is_private || (!m.is_abstract && !m.is_virtual && m.base_method != null)) {
+ if ((m.is_constructor && current_class != null && current_class.is_abstract)
+ || m.is_override
+ || m.is_private
+ || (!m.is_abstract && !m.is_virtual && m.base_method != null))
+ {
return;
}
}
if (!m.is_static && !m.is_constructor) {
- add_custom_header ("self", "the %s instance".printf (get_docbook_link (m.parent)), null, 0.1);
+ add_custom_header ("self",
+ "the %s instance".printf (get_docbook_link (m.parent)),
+ null,
+ 0.1);
}
if (m.is_constructor) {
foreach (Api.Node _type in type_parameters) {
var type = _type as Api.TypeParameter;
string type_name_down = type.name.down ();
- add_custom_header (type_name_down + "_type", "A #GType");
- add_custom_header (type_name_down + "_dup_func", "A dup function for @%s_type".printf (type_name_down));
- add_custom_header (type_name_down + "_destroy_func", "A destroy function for @%s_type".printf (type_name_down));
+ add_custom_header (type_name_down + "_type",
+ "A #GType");
+ add_custom_header (type_name_down + "_dup_func",
+ "A dup function for @%s_type".printf (type_name_down));
+ add_custom_header (type_name_down + "_destroy_func",
+ "A destroy function for @%s_type".printf (type_name_down));
}
}
foreach (Api.Node _type in type_parameters) {
var type = _type as Api.TypeParameter;
string type_name_down = type.name.down ();
- add_custom_header (type_name_down + "_type", "The #GType for @%s".printf (type_name_down), null, 0.2);
- add_custom_header (type_name_down + "_dup_func", "A dup function for @%s_type".printf (type_name_down), null, 0.3);
- add_custom_header (type_name_down + "_destroy_func", "A destroy function for @%s_type".printf (type_name_down), null, 0.4);
+ add_custom_header (type_name_down + "_type",
+ "The #GType for @%s".printf (type_name_down),
+ null,
+ 0.2);
+ add_custom_header (type_name_down + "_dup_func",
+ "A dup function for @%s_type".printf (type_name_down),
+ null,
+ 0.3);
+ add_custom_header (type_name_down + "_destroy_func",
+ "A destroy function for @%s_type".printf (type_name_down),
+ null,
+ 0.4);
}
m.accept_children ({NodeType.FORMAL_PARAMETER, NodeType.TYPE_PARAMETER}, this);
Header error_header = null;
GComment gcomment = null;
if (m.is_yields) {
- add_custom_header ("_callback_", "callback to call when the request is satisfied", {"scope async"});
- add_custom_header ("_user_data_", "the data to pass to @_callback_ function", {"closure"});
+ add_custom_header ("_callback_",
+ "callback to call when the request is satisfied",
+ {"scope async"});
+ add_custom_header ("_user_data_",
+ "the data to pass to @_callback_ function",
+ {"closure"});
// remove error from here, put that in the _finish function
error_header = remove_custom_header ("error");
see_also += get_docbook_link (m, false, true);
gcomment.see_also = see_also;
} else {
- gcomment = add_symbol (m.get_filename(), m.get_cname (), m.documentation, null, annotations);
+ gcomment = add_symbol (m.get_filename(),
+ m.get_cname (),
+ m.documentation,
+ null,
+ annotations);
}
// Handle attributes for things like deprecation.
if (current_dbus_interface != null && m.is_dbus_visible && !m.is_constructor) {
if (m.return_type != null && m.return_type.data_type != null) {
- var dresult = new DBus.Parameter (m.get_dbus_result_name (), m.return_type.get_dbus_type_signature (), DBus.Parameter.Direction.OUT);
+ var dresult = new DBus.Parameter (m.get_dbus_result_name (),
+ m.return_type.get_dbus_type_signature (),
+ DBus.Parameter.Direction.OUT);
current_dbus_member.add_parameter (dresult);
}
- var dbus_gcomment = create_gcomment (m.get_dbus_name (), m.documentation, null, true);
+ var dbus_gcomment = create_gcomment (m.get_dbus_name (),
+ m.documentation,
+ null,
+ true);
current_dbus_member.comment = dbus_gcomment;
current_dbus_interface.add_method (current_dbus_member);
}
Api.TypeParameter type_parameter = m.return_type.data_type as Api.TypeParameter;
if (type_parameter != null) {
if (type_parameter.parent is Api.Class) {
- return_type_desc = "A value from type #%s:%s-type.".printf (get_cname (m.parent), type_parameter.name.down ());
- } else if (type_parameter.parent is Api.Interface && ((Api.Symbol) type_parameter.parent).get_attribute ("GenericAccessors") != null) {
- return_type_desc = "A value from type #_%sIface.get_%s_type().".printf (get_cname (m.parent), type_parameter.name.down ());
+ return_type_desc = "A value from type #%s:%s-type."
+ .printf (get_cname (m.parent), type_parameter.name.down ());
+ } else if (type_parameter.parent is Api.Interface
+ && ((Api.Symbol) type_parameter.parent).get_attribute ("GenericAccessors") != null)
+ {
+ return_type_desc = "A value from type #_%sIface.get_%s_type()."
+ .printf (get_cname (m.parent), type_parameter.name.down ());
} else if (type_parameter.parent is Api.Struct) {
// type not stored
} else if (type_parameter.parent == m) {
}
if (m.is_yields) {
- var finish_gcomment = add_symbol (m.get_filename(), m.get_finish_function_cname (), m.documentation);
+ var finish_gcomment = add_symbol (m.get_filename(),
+ m.get_finish_function_cname (),
+ m.documentation);
finish_gcomment.headers.clear ();
if (!m.is_static) {
- finish_gcomment.headers.add (new Header ("self", "the %s instance".printf (get_docbook_link (m.parent))));
+ finish_gcomment.headers.add (new Header ("self",
+ "the %s instance".printf (get_docbook_link (m.parent))));
}
- finish_gcomment.headers.add (new Header ("_res_", "a <link linkend=\"GAsyncResult\"><type>GAsyncResult</type></link>"));
+ finish_gcomment.headers.add (new Header ("_res_",
+ "a <link linkend=\"GAsyncResult\"><type>GAsyncResult</type></link>"));
if (error_header != null) {
finish_gcomment.headers.add (error_header);
}
if (m.is_constructor && !m.get_cname ().has_suffix ("_new")) {
- // Hide secondary _construct methods from the documentation (the primary _construct method is hidden in visit_class())
+ // Hide secondary _construct methods from the documentation
+ // (the primary _construct method is hidden in visit_class())
var file_data = get_file_data (m.get_filename ());
file_data.private_section_lines.add (m.get_cname ().replace ("_new", "_construct"));
}
}
if (!m.is_private && !m.is_protected && !m.is_internal) {
- add_custom_header (m.name, "virtual method called by %s".printf (get_docbook_link (m)));
+ add_custom_header (m.name, "virtual method called by %s"
+ .printf (get_docbook_link (m)));
if (m.is_yields) {
- add_custom_header (m.name + "_finish", "asynchronous finish function for <structfield>%s</structfield>, called by %s".printf (m.name, get_docbook_link (m)));
+ add_custom_header (m.name + "_finish", "asynchronous finish function for <structfield>%s</structfield>, called by %s"
+ .printf (m.name, get_docbook_link (m)));
}
} else {
add_custom_header (m.name, "virtual method used internally");
}
if (prop.getter != null && !prop.getter.is_private && !prop.getter.is_internal && prop.getter.is_get) {
- add_custom_header ("get_" + prop.name, "getter method for the abstract property %s".printf (get_docbook_link (prop)));
+ add_custom_header ("get_" + prop.name, "getter method for the abstract property %s"
+ .printf (get_docbook_link (prop)));
}
if (prop.setter != null && !prop.setter.is_private && !prop.setter.is_internal && prop.setter.is_set && !prop.setter.is_construct) {
- add_custom_header ("set_" + prop.name, "setter method for the abstract property %s".printf (get_docbook_link (prop)));
+ add_custom_header ("set_" + prop.name, "setter method for the abstract property %s"
+ .printf (get_docbook_link (prop)));
}
}
TypeParameter type_parameter = param.parameter_type.data_type as TypeParameter;
if (type_parameter != null) {
if (type_parameter.parent is Api.Class) {
- add_custom_header (param_name, "A parameter from type #%s:%s-type.".printf (get_cname (type_parameter.parent), type_parameter.name.down ()), null, double.MAX, false);
- } else if (type_parameter.parent is Api.Interface && ((Api.Symbol) type_parameter.parent).get_attribute ("GenericAccessors") != null) {
- add_custom_header (param_name, "A parameter from type #_%sIface.get_%s_type().".printf (get_cname (type_parameter.parent), type_parameter.name.down ()), null, double.MAX, false);
+ add_custom_header (param_name, "A parameter from type #%s:%s-type."
+ .printf (get_cname (type_parameter.parent), type_parameter.name.down ()), null, double.MAX, false);
+ } else if (type_parameter.parent is Api.Interface && ((Api.Symbol) type_parameter.parent)
+ .get_attribute ("GenericAccessors") != null) {
+ add_custom_header (param_name, "A parameter from type #_%sIface.get_%s_type()."
+ .printf (get_cname (type_parameter.parent), type_parameter.name.down ()), null, double.MAX, false);
} else if (type_parameter.parent is Api.Struct) {
// type not stored
} else if (type_parameter.parent is Method) {
- add_custom_header (param_name, "A parameter from type @%s_type.".printf (type_parameter.name.down ()), null, double.MAX, false);
+ add_custom_header (param_name, "A parameter from type @%s_type."
+ .printf (type_parameter.name.down ()), null, double.MAX, false);
}
}
annotations += "allow-none";
}
- if (param.parameter_type.is_owned && !(param.parameter_type.data_type is Api.Delegate)) {
+ if (param.parameter_type.is_owned
+ && !(param.parameter_type.data_type is Api.Delegate))
+ {
annotations += "transfer full";
}
if (param.parameter_type.data_type is Api.Array) {
annotations += "array length=%s_length1".printf (param_name);
- add_custom_header ("%s_length1".printf (param_name), "length of the @%s array".printf (param_name),
- null, get_parameter_pos (current_method_or_delegate, param_name)+0.1);
+ add_custom_header ("%s_length1".printf (param_name),
+ "length of the @%s array".printf (param_name),
+ null,
+ get_parameter_pos (current_method_or_delegate, param_name)+0.1);
}
- if (!param.ellipsis && param.parameter_type.data_type != null && get_cname (param.parameter_type.data_type) == "GError") {
+ if (!param.ellipsis && param.parameter_type.data_type != null
+ && get_cname (param.parameter_type.data_type) == "GError")
+ {
annotations += "not-error";
}
} else if (param.is_out) {
ddirection = DBus.Parameter.Direction.OUT;
}
- var dparam = new DBus.Parameter (param_name, param.parameter_type.get_dbus_type_signature (), ddirection);
+ var dparam = new DBus.Parameter (param_name,
+ param.parameter_type.get_dbus_type_signature (),
+ ddirection);
current_dbus_member.add_parameter (dparam);
}
param.accept_all_children (this);
replacement_symbol_name = replacement_symbol_name[0:-2];
}
- replacement_symbol = current_tree.search_symbol_str (sym, replacement_symbol_name);
+ replacement_symbol = current_tree.search_symbol_str (sym,
+ replacement_symbol_name);
}
if (replacement != null && replacement_symbol == null) {
- reporter.simple_warning ("Couldn’t resolve replacement symbol ‘%s’ for ‘Deprecated’ attribute on %s.", replacement_symbol_name, sym.get_full_name ());
+ reporter.simple_warning ("Couldn’t resolve replacement symbol ‘%s’ for ‘Deprecated’ attribute on %s.",
+ replacement_symbol_name,
+ sym.get_full_name ());
}
var deprecation_string = "No replacement specified.";
} else if (since == null && replacement_symbol != null) {
deprecation_string = "Replaced by %s.".printf (get_gtkdoc_link (replacement_symbol));
} else {
- reporter.simple_warning ("Missing ‘since’ and ‘replacement’ arguments to ‘Deprecated’ attribute on %s.", sym.get_full_name ());
+ reporter.simple_warning ("Missing ‘since’ and ‘replacement’ arguments to ‘Deprecated’ attribute on %s.",
+ sym.get_full_name ());
}
gcomment.versioning.add (new Header ("Deprecated", deprecation_string));
}
public string get_docbook_type_link (Api.Class cls) {
- return """<link linkend="%s:CAPS"><literal>%s</literal></link>""".printf (to_docbook_id (cls.get_type_id ()), cls.get_type_id ());
+ return """<link linkend="%s:CAPS"><literal>%s</literal></link>"""
+ .printf (to_docbook_id (cls.get_type_id ()), cls.get_type_id ());
}
public string? get_gtkdoc_link (Api.Node symbol) {
- if (symbol is Class || symbol is Interface || symbol is Struct || symbol is Enum || symbol is ErrorDomain) {
+ if (symbol is Class || symbol is Interface || symbol is Struct || symbol is Enum
+ || symbol is ErrorDomain)
+ {
return "#%s".printf (get_cname (symbol));
}
}
parent = "";
}
- return """<link linkend="%s%s"><function>%s()</function></link>""".printf (to_docbook_id (parent), to_docbook_id (name), name);
+ return """<link linkend="%s%s"><function>%s()</function></link>"""
+ .printf (to_docbook_id (parent), to_docbook_id (name), name);
} else if (item is Api.FormalParameter) {
return "<parameter>%s</parameter>".printf (((Api.FormalParameter)item).name);
} else if (item is Api.Constant) {
var cname = ((Api.Constant)item).get_cname ();
- return """<link linkend="%s:CAPS"><literal>%s</literal></link>""".printf (to_docbook_id (cname), cname);
+ return """<link linkend="%s:CAPS"><literal>%s</literal></link>"""
+ .printf (to_docbook_id (cname), cname);
} else if (item is Api.ErrorCode) {
var cname = ((Api.ErrorCode)item).get_cname ();
- return """<link linkend="%s:CAPS"><literal>%s</literal></link>""".printf (to_docbook_id (cname), cname);
+ return """<link linkend="%s:CAPS"><literal>%s</literal></link>"""
+ .printf (to_docbook_id (cname), cname);
} else if (item is Api.Property) {
string name;
string parent;
name = ((Api.Property)item).get_cname ();
parent = get_cname (item.parent);
}
- return """<link linkend="%s--%s"><type>"%s"</type></link>""".printf (to_docbook_id (parent), to_docbook_id (name), name);
+ return """<link linkend="%s--%s"><type>"%s"</type></link>"""
+ .printf (to_docbook_id (parent), to_docbook_id (name), name);
} else if (item is Api.Signal) {
string name;
string parent;
name = name.replace ("_", "-");
parent = get_cname (item.parent);
}
- return """<link linkend="%s-%s"><type>"%s"</type></link>""".printf (to_docbook_id (parent), to_docbook_id (name), name);
+ return """<link linkend="%s-%s"><type>"%s"</type></link>"""
+ .printf (to_docbook_id (parent), to_docbook_id (name), name);
} else {
var cname = get_cname (item);
if (cname != null) {
- return """<link linkend="%s"><type>%s</type></link>""".printf (to_docbook_id (cname), cname);
+ return """<link linkend="%s"><type>%s</type></link>"""
+ .printf (to_docbook_id (cname), cname);
}
}
return null;
Process.spawn_command_line_sync (pc, null, null, out exit_status);
return (0 == exit_status);
} catch (SpawnError e) {
- reporter.simple_warning ("GtkDoc: warning: Error pkg-config --exists %s: %s", package_name, e.message);
+ reporter.simple_warning ("GtkDoc: warning: Error pkg-config --exists %s: %s",
+ package_name,
+ e.message);
return false;
}
}
gir_directory = settings.gir_directory;
}
- gir_writer.write_file ((Vala.CodeContext) tree.data, gir_directory, settings.gir_namespace, settings.gir_version, settings.pkg_name);
+ gir_writer.write_file ((Vala.CodeContext) tree.data,
+ gir_directory,
+ settings.gir_namespace,
+ settings.gir_version,
+ settings.pkg_name);
}
public Api.Tree? build (Settings settings, ErrorReporter reporter) {
&& ((Vala.SourceFile) file.data).file_type == Vala.SourceFileType.SOURCE)
) {
Vala.SourceReference pos = c.source_reference;
- comment = new SourceComment (c.content, file, pos.first_line, pos.first_column, pos.last_line, pos.last_column);
+ comment = new SourceComment (c.content,
+ file,
+ pos.first_line,
+ pos.first_column,
+ pos.last_line,
+ pos.last_column);
break;
}
}
}
private TypeReference create_type_reference (Vala.DataType? vtyperef, Item parent, Api.Node caller) {
- bool is_nullable = vtyperef != null && vtyperef.nullable && !(vtyperef is Vala.GenericType) && !(vtyperef is Vala.PointerType);
- string? signature = (vtyperef != null && vtyperef.data_type != null)? Vala.GVariantModule.get_dbus_signature (vtyperef.data_type) : null;
+ bool is_nullable = vtyperef != null
+ && vtyperef.nullable
+ && !(vtyperef is Vala.GenericType)
+ && !(vtyperef is Vala.PointerType);
+ string? signature = (vtyperef != null && vtyperef.data_type != null)
+ ? Vala.GVariantModule.get_dbus_signature (vtyperef.data_type)
+ : null;
bool pass_ownership = type_reference_pass_ownership (vtyperef);
Ownership ownership = get_type_reference_ownership (vtyperef);
bool is_dynamic = vtyperef != null && vtyperef.is_dynamic;
- TypeReference type_ref = new TypeReference (parent, ownership, pass_ownership, is_dynamic, is_nullable, signature, vtyperef);
+ TypeReference type_ref = new TypeReference (parent,
+ ownership,
+ pass_ownership,
+ is_dynamic,
+ is_nullable,
+ signature,
+ vtyperef);
if (vtyperef is Vala.PointerType) {
type_ref.data_type = create_pointer ((Vala.PointerType) vtyperef, type_ref, caller);
} else if (vtyperef is Vala.ArrayType) {
type_ref.data_type = create_array ((Vala.ArrayType) vtyperef, type_ref, caller);
//} else if (vtyperef is Vala.GenericType) {
- // type_ref.data_type = new TypeParameter (caller, caller.get_source_file (), ((Vala.GenericType) vtyperef).type_parameter.name, vtyperef);
+ // type_ref.data_type = new TypeParameter (caller,
+ // caller.get_source_file (),
+ // ((Vala.GenericType) vtyperef).type_parameter.name,
+ // vtyperef);
}
// type parameters:
var cl = element as Vala.Class;
if (cl != null && cl.type_check_function != null) {
return cl.type_check_function;
- } else if ((cl != null && cl.is_compact) || element is Vala.Struct || element is Vala.Enum || element is Vala.Delegate) {
+ } else if ((cl != null && cl.is_compact)
+ || element is Vala.Struct
+ || element is Vala.Enum
+ || element is Vala.Delegate)
+ {
return null;
} else {
return element.get_upper_case_cname ("IS_");
}
private string? get_type_function_name (Vala.TypeSymbol element) {
- if ((element is Vala.Class && ((Vala.Class) element).is_compact) || element is Vala.ErrorDomain || element is Vala.Delegate) {
+ if ((element is Vala.Class && ((Vala.Class) element).is_compact)
+ || element is Vala.ErrorDomain
+ || element is Vala.Delegate)
+ {
return null;
}
}
private string? get_type_macro_name (Vala.TypeSymbol element) {
- if ((element is Vala.Class && ((Vala.Class) element).is_compact) || element is Vala.ErrorDomain || element is Vala.Delegate) {
+ if ((element is Vala.Class && ((Vala.Class) element).is_compact)
+ || element is Vala.ErrorDomain
+ || element is Vala.Delegate)
+ {
return null;
}
if (comment != null) {
Vala.SourceReference pos = comment.source_reference;
SourceFile file = files.get (pos.file);
- return new SourceComment (comment.content, file, pos.first_line, pos.first_column, pos.last_line, pos.last_column);
+ return new SourceComment (comment.content,
+ file,
+ pos.first_line,
+ pos.first_column,
+ pos.last_line,
+ pos.last_column);
}
return null;
}
private SourceFile register_source_file (PackageMetaData meta_data, Vala.SourceFile source_file) {
- SourceFile file = new SourceFile (meta_data.package, source_file.get_relative_filename (), source_file.get_csource_filename (), source_file);
+ SourceFile file = new SourceFile (meta_data.package,
+ source_file.get_relative_filename (),
+ source_file.get_csource_filename (),
+ source_file);
files.set (source_file, file);
meta_data.register_source_file (source_file);
}
// non ref counted types are weak, not unowned
- if (element.data_type is Vala.TypeSymbol && is_reference_counting ((Vala.TypeSymbol) element.data_type) == true) {
+ if (element.data_type is Vala.TypeSymbol
+ && is_reference_counting ((Vala.TypeSymbol) element.data_type) == true)
+ {
return false;
}
}
// non ref counted types are unowned, not weak
- if (element.data_type is Vala.TypeSymbol && is_reference_counting ((Vala.TypeSymbol) element.data_type) == false) {
+ if (element.data_type is Vala.TypeSymbol
+ && is_reference_counting ((Vala.TypeSymbol) element.data_type) == false)
+ {
return false;
}
register_source_file (source_package, vfile);
- add_deps (context, Path.build_filename (Path.get_dirname (source), "%s.deps".printf (file_name)), file_name);
+ add_deps (context, Path.build_filename (Path.get_dirname (source),
+ "%s.deps".printf (file_name)),
+ file_name);
} else if (source.has_suffix (".c")) {
context.add_c_source_file (rpath);
tree.add_external_c_files (rpath);
bool is_basic_type = element.base_class == null && element.name == "string";
- Class node = new Class (parent, file, element.name, get_access_modifier (element), comment, get_cname (element), get_private_cname (element), get_class_macro_name (element), get_type_macro_name (element), get_is_type_macro_name (element), get_type_cast_macro_name (element), get_type_function_name (element), get_class_type_macro_name (element), get_is_class_type_macro_name (element), Vala.GDBusModule.get_dbus_name (element), get_ccode_type_id (element), get_param_spec_function (element), get_ref_function (element), get_unref_function (element), get_free_function_name (element), get_finalize_function_name (element), get_take_value_function (element), get_get_value_function (element), get_set_value_function (element), element.is_fundamental (), element.is_abstract, is_basic_type, element);
-
+ Class node = new Class (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ get_private_cname (element),
+ get_class_macro_name (element),
+ get_type_macro_name (element),
+ get_is_type_macro_name (element),
+ get_type_cast_macro_name (element),
+ get_type_function_name (element),
+ get_class_type_macro_name (element),
+ get_is_class_type_macro_name (element),
+ Vala.GDBusModule.get_dbus_name (element),
+ get_ccode_type_id (element),
+ get_param_spec_function (element),
+ get_ref_function (element),
+ get_unref_function (element),
+ get_free_function_name (element),
+ get_finalize_function_name (element),
+ get_take_value_function (element),
+ get_get_value_function (element),
+ get_set_value_function (element),
+ element.is_fundamental (),
+ element.is_abstract,
+ is_basic_type,
+ element);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Interface node = new Interface (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), get_type_macro_name (element), get_is_type_macro_name (element), get_type_cast_macro_name (element), get_type_function_name (element), get_interface_macro_name (element), Vala.GDBusModule.get_dbus_name (element), element);
+ Interface node = new Interface (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ get_type_macro_name (element),
+ get_is_type_macro_name (element),
+ get_type_cast_macro_name (element),
+ get_type_function_name (element),
+ get_interface_macro_name (element),
+ Vala.GDBusModule.get_dbus_name (element),
+ element);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- bool is_basic_type = element.base_type == null && (element.is_boolean_type () || element.is_floating_type () || element.is_integer_type ());
-
- Struct node = new Struct (parent, file, element.name, get_access_modifier(element), comment, get_cname(element), get_type_macro_name (element), get_type_function_name (element), get_ccode_type_id (element), get_dup_function (element), get_copy_function (element), get_struct_destroy_function (element), get_free_function (element), is_basic_type, element);
+ bool is_basic_type = element.base_type == null
+ && (element.is_boolean_type ()
+ || element.is_floating_type ()
+ || element.is_integer_type ());
+
+ Struct node = new Struct (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment, get_cname (element),
+ get_type_macro_name (element),
+ get_type_function_name (element),
+ get_ccode_type_id (element),
+ get_dup_function (element),
+ get_copy_function (element),
+ get_struct_destroy_function (element),
+ get_free_function (element),
+ is_basic_type,
+ element);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Field node = new Field (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), element.binding == Vala.MemberBinding.STATIC, element.is_volatile, element);
+ Field node = new Field (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ element.binding == Vala.MemberBinding.STATIC,
+ element.is_volatile,
+ element);
node.field_type = create_type_reference (element.variable_type, node, node);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Property node = new Property (parent, file, element.name, get_access_modifier(element), comment, get_nick (element), Vala.GDBusModule.get_dbus_name_for_member (element), Vala.GDBusServerModule.is_dbus_visible (element), get_property_binding_type (element), element);
+ Property node = new Property (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_nick (element),
+ Vala.GDBusModule.get_dbus_name_for_member (element),
+ Vala.GDBusServerModule.is_dbus_visible (element),
+ get_property_binding_type (element),
+ element);
node.property_type = create_type_reference (element.property_type, node, node);
symbol_map.set (element, node);
parent.add_child (node);
// Process property type
if (element.get_accessor != null) {
var accessor = element.get_accessor;
- node.getter = new PropertyAccessor (node, file, element.name, get_access_modifier(accessor), get_cname (accessor), get_property_accessor_type (accessor), get_property_ownership (accessor), accessor);
+ node.getter = new PropertyAccessor (node,
+ file,
+ element.name,
+ get_access_modifier (accessor),
+ get_cname (accessor),
+ get_property_accessor_type (accessor),
+ get_property_ownership (accessor),
+ accessor);
}
if (element.set_accessor != null) {
var accessor = element.set_accessor;
- node.setter = new PropertyAccessor (node, file, element.name, get_access_modifier(accessor), get_cname (accessor), get_property_accessor_type (accessor), get_property_ownership (accessor), accessor);
+ node.setter = new PropertyAccessor (node,
+ file,
+ element.name,
+ get_access_modifier (accessor),
+ get_cname (accessor),
+ get_property_accessor_type (accessor),
+ get_property_ownership (accessor),
+ accessor);
}
process_attributes (node, element.attributes);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Method node = new Method (parent, file, get_method_name (element), get_access_modifier(element), comment, get_cname (element), Vala.GDBusModule.get_dbus_name_for_member (element), Vala.GDBusServerModule.dbus_result_name (element), (element.coroutine)? get_finish_name (element) : null, get_method_binding_type (element), element.coroutine, Vala.GDBusServerModule.is_dbus_visible (element), element is Vala.CreationMethod, element);
+ Method node = new Method (parent,
+ file,
+ get_method_name (element),
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ Vala.GDBusModule.get_dbus_name_for_member (element),
+ Vala.GDBusServerModule.dbus_result_name (element),
+ (element.coroutine)? get_finish_name (element) : null,
+ get_method_binding_type (element),
+ element.coroutine,
+ Vala.GDBusServerModule.is_dbus_visible (element),
+ element is Vala.CreationMethod,
+ element);
node.return_type = create_type_reference (element.return_type, node, node);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Method node = new Method (parent, file, get_method_name (element), get_access_modifier(element), comment, get_cname (element), Vala.GDBusModule.get_dbus_name_for_member (element), Vala.GDBusServerModule.dbus_result_name (element), (element.coroutine)? get_finish_name (element) : null, get_method_binding_type (element), element.coroutine, Vala.GDBusServerModule.is_dbus_visible (element), element is Vala.CreationMethod, element);
+ Method node = new Method (parent,
+ file,
+ get_method_name (element),
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ Vala.GDBusModule.get_dbus_name_for_member (element),
+ Vala.GDBusServerModule.dbus_result_name (element),
+ (element.coroutine)? get_finish_name (element) : null,
+ get_method_binding_type (element),
+ element.coroutine,
+ Vala.GDBusServerModule.is_dbus_visible (element),
+ element is Vala.CreationMethod,
+ element);
node.return_type = create_type_reference (element.return_type, node, node);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Api.Signal node = new Api.Signal (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), Vala.GDBusModule.get_dbus_name_for_member (element), Vala.GDBusServerModule.is_dbus_visible (element), element.is_virtual, element);
+ Api.Signal node = new Api.Signal (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ Vala.GDBusModule.get_dbus_name_for_member (element),
+ Vala.GDBusServerModule.is_dbus_visible (element),
+ element.is_virtual,
+ element);
node.return_type = create_type_reference (element.return_type, node, node);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Delegate node = new Delegate (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), !element.has_target, element);
+ Delegate node = new Delegate (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment, get_cname (element),
+ !element.has_target,
+ element);
node.return_type = create_type_reference (element.return_type, node, node);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Symbol node = new Enum (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), get_type_macro_name (element), get_type_function_name (element), element);
+ Symbol node = new Enum (parent,
+ file,
+ element.name,
+ get_access_modifier(element),
+ comment,
+ get_cname (element),
+ get_type_macro_name (element),
+ get_type_function_name (element),
+ element);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Symbol node = new Api.EnumValue (parent, file, element.name, comment, get_cname (element), element);
+ Symbol node = new Api.EnumValue (parent,
+ file,
+ element.name,
+ comment,
+ get_cname (element),
+ element);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Constant node = new Constant (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), element);
+ Constant node = new Constant (parent,
+ file, element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ element);
node.constant_type = create_type_reference (element.type_reference, node, node);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Symbol node = new ErrorDomain (parent, file, element.name, get_access_modifier (element), comment, get_cname (element), get_quark_macro_name (element), get_quark_function_name (element), Vala.GDBusModule.get_dbus_name (element), element);
+ Symbol node = new ErrorDomain (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ get_quark_macro_name (element),
+ get_quark_function_name (element),
+ Vala.GDBusModule.get_dbus_name (element),
+ element);
symbol_map.set (element, node);
parent.add_child (node);
SourceComment? comment = create_comment (element.comment);
- Symbol node = new Api.ErrorCode (parent, file, element.name, comment, get_cname (element), Vala.GDBusModule.get_dbus_name_for_member (element), element);
+ Symbol node = new Api.ErrorCode (parent,
+ file,
+ element.name,
+ comment,
+ get_cname (element),
+ Vala.GDBusModule.get_dbus_name_for_member (element),
+ element);
symbol_map.set (element, node);
parent.add_child (node);
Api.Node parent = get_parent_node_for (element);
SourceFile? file = get_source_file (element);
- FormalParameter node = new FormalParameter (parent, file, element.name, get_access_modifier(element), get_formal_parameter_type (element), element.ellipsis, element);
+ FormalParameter node = new FormalParameter (parent,
+ file,
+ element.name,
+ get_access_modifier(element),
+ get_formal_parameter_type (element),
+ element.ellipsis,
+ element);
node.parameter_type = create_type_reference (element.variable_type, node, node);
parent.add_child (node);
gir_directory = settings.gir_directory;
}
- gir_writer.write_file ((Vala.CodeContext) tree.data, gir_directory, settings.gir_namespace, settings.gir_version, settings.pkg_name);
+ gir_writer.write_file ((Vala.CodeContext) tree.data,
+ gir_directory,
+ settings.gir_namespace,
+ settings.gir_version,
+ settings.pkg_name);
}
public Api.Tree? build (Settings settings, ErrorReporter reporter) {
Vala.SourceReference pos = c.source_reference;
#if ! VALA_0_15_0
if (c is Vala.GirComment) {
- comment = new GirSourceComment (c.content, file, pos.first_line, pos.first_column, pos.last_line, pos.last_column);
+ comment = new GirSourceComment (c.content,
+ file,
+ pos.first_line,
+ pos.first_column,
+ pos.last_line,
+ pos.last_column);
} else {
- comment = new SourceComment (c.content, file, pos.first_line, pos.first_column, pos.last_line, pos.last_column);
+ comment = new SourceComment (c.content,
+ file,
+ pos.first_line,
+ pos.first_column,
+ pos.last_line,
+ pos.last_column);
}
#else
- comment = new SourceComment (c.content, file, pos.first_line, pos.first_column, pos.last_line, pos.last_column);
+ comment = new SourceComment (c.content,
+ file,
+ pos.first_line,
+ pos.first_column,
+ pos.last_line,
+ pos.last_column);
#endif
break;
}
}
private TypeReference create_type_reference (Vala.DataType? vtyperef, Item parent, Api.Node caller) {
- bool is_nullable = vtyperef != null && vtyperef.nullable && !(vtyperef is Vala.GenericType) && !(vtyperef is Vala.PointerType);
- string? signature = (vtyperef != null && vtyperef.data_type != null)? Vala.GVariantModule.get_dbus_signature (vtyperef.data_type) : null;
+ bool is_nullable = vtyperef != null
+ && vtyperef.nullable
+ && !(vtyperef is Vala.GenericType)
+ && !(vtyperef is Vala.PointerType);
+ string? signature = (vtyperef != null && vtyperef.data_type != null)
+ ? Vala.GVariantModule.get_dbus_signature (vtyperef.data_type)
+ : null;
bool pass_ownership = type_reference_pass_ownership (vtyperef);
Ownership ownership = get_type_reference_ownership (vtyperef);
bool is_dynamic = vtyperef != null && vtyperef.is_dynamic;
- TypeReference type_ref = new TypeReference (parent, ownership, pass_ownership, is_dynamic, is_nullable, signature, vtyperef);
+ TypeReference type_ref = new TypeReference (parent,
+ ownership,
+ pass_ownership,
+ is_dynamic,
+ is_nullable,
+ signature,
+ vtyperef);
if (vtyperef is Vala.PointerType) {
type_ref.data_type = create_pointer ((Vala.PointerType) vtyperef, type_ref, caller);
} else if (vtyperef is Vala.ArrayType) {
type_ref.data_type = create_array ((Vala.ArrayType) vtyperef, type_ref, caller);
//} else if (vtyperef is Vala.GenericType) {
- // type_ref.data_type = new TypeParameter (caller, caller.get_source_file (), ((Vala.GenericType) vtyperef).type_parameter.name, vtyperef);
+ // type_ref.data_type = new TypeParameter (caller,
+ // caller.get_source_file (),
+ // ((Vala.GenericType) vtyperef).type_parameter.name,
+ // vtyperef);
}
// type parameters:
}
private string? get_type_function_name (Vala.TypeSymbol element) {
- if ((element is Vala.Class && ((Vala.Class) element).is_compact) || element is Vala.ErrorDomain || element is Vala.Delegate) {
+ if ((element is Vala.Class && ((Vala.Class) element).is_compact)
+ || element is Vala.ErrorDomain
+ || element is Vala.Delegate)
+ {
return null;
}
}
private string? get_type_macro_name (Vala.TypeSymbol element) {
- if ((element is Vala.Class && ((Vala.Class) element).is_compact) || element is Vala.ErrorDomain || element is Vala.Delegate) {
+ if ((element is Vala.Class && ((Vala.Class) element).is_compact)
+ || element is Vala.ErrorDomain
+ || element is Vala.Delegate)
+ {
return null;
}
if (comment != null) {
Vala.SourceReference pos = comment.source_reference;
SourceFile file = files.get (pos.file);
- return new SourceComment (comment.content, file, pos.first_line, pos.first_column, pos.last_line, pos.last_column);
+ return new SourceComment (comment.content,
+ file,
+ pos.first_line,
+ pos.first_column,
+ pos.last_line,
+ pos.last_column);
}
#else
if (comment != null) {
Vala.SourceReference pos = comment.source_reference;
SourceFile file = files.get (pos.file);
if (comment is Vala.GirComment) {
- var tmp = new GirSourceComment (comment.content, file, pos.first_line, pos.first_column, pos.last_line, pos.last_column);
+ var tmp = new GirSourceComment (comment.content,
+ file,
+ pos.first_line,
+ pos.first_column,
+ pos.last_line,
+ pos.last_column);
if (((Vala.GirComment) comment).return_content != null) {
Vala.SourceReference return_pos = ((Vala.GirComment) comment).return_content.source_reference;
- tmp.return_comment = new SourceComment (((Vala.GirComment) comment).return_content.content, file, return_pos.first_line, return_pos.first_column, return_pos.last_line, return_pos.last_column);
+ tmp.return_comment = new SourceComment (((Vala.GirComment) comment).return_content.content,
+ file,
+ return_pos.first_line,
+ return_pos.first_column,
+ return_pos.last_line,
+ return_pos.last_column);
}
Vala.MapIterator<string, Vala.Comment> it = ((Vala.GirComment) comment).parameter_iterator ();
while (it.next ()) {
Vala.Comment vala_param = it.get_value ();
Vala.SourceReference param_pos = vala_param.source_reference;
- var param_comment = new SourceComment (vala_param.content, file, param_pos.first_line, param_pos.first_column, param_pos.last_line, param_pos.last_column);
+ var param_comment = new SourceComment (vala_param.content,
+ file,
+ param_pos.first_line,
+ param_pos.first_column,
+ param_pos.last_line,
+ param_pos.last_column);
tmp.add_parameter_content (it.get_key (), param_comment);
}
return tmp;
} else {
- return new SourceComment (comment.content, file, pos.first_line, pos.first_column, pos.last_line, pos.last_column);
+ return new SourceComment (comment.content,
+ file,
+ pos.first_line,
+ pos.first_column,
+ pos.last_line,
+ pos.last_column);
}
}
#endif
}
private SourceFile register_source_file (PackageMetaData meta_data, Vala.SourceFile source_file) {
- SourceFile file = new SourceFile (meta_data.package, source_file.get_relative_filename (), source_file.get_csource_filename (), source_file);
+ SourceFile file = new SourceFile (meta_data.package,
+ source_file.get_relative_filename (),
+ source_file.get_csource_filename (),
+ source_file);
files.set (source_file, file);
meta_data.register_source_file (source_file);
}
// non ref counted types are weak, not unowned
- if (element.data_type is Vala.TypeSymbol && is_reference_counting ((Vala.TypeSymbol) element.data_type) == true) {
+ if (element.data_type is Vala.TypeSymbol
+ && is_reference_counting ((Vala.TypeSymbol) element.data_type) == true)
+ {
return false;
}
}
// non ref counted types are unowned, not weak
- if (element.data_type is Vala.TypeSymbol && is_reference_counting ((Vala.TypeSymbol) element.data_type) == false) {
+ if (element.data_type is Vala.TypeSymbol
+ && is_reference_counting ((Vala.TypeSymbol) element.data_type) == false)
+ {
return false;
}
register_source_file (source_package, vfile);
- add_deps (context, Path.build_filename (Path.get_dirname (source), "%s.deps".printf (file_name)), file_name);
+ add_deps (context, Path.build_filename (Path.get_dirname (source),
+ "%s.deps".printf (file_name)),
+ file_name);
} else if (source.has_suffix (".c")) {
context.add_c_source_file (rpath);
tree.add_external_c_files (rpath);
bool is_basic_type = element.base_class == null && element.name == "string";
- Class node = new Class (parent, file, element.name, get_access_modifier (element), comment, get_cname (element), get_private_cname (element), get_class_macro_name (element), get_type_macro_name (element), get_is_type_macro_name (element), get_type_cast_macro_name (element), get_type_function_name (element), get_class_type_macro_name (element), get_is_class_type_macro_name (element), Vala.GDBusModule.get_dbus_name (element), get_ccode_type_id (element), get_param_spec_function (element), get_ref_function (element), get_unref_function (element), get_free_function_name (element), get_finalize_function_name (element), get_take_value_function (element), get_get_value_function (element), get_set_value_function (element), element.is_fundamental (), element.is_abstract, is_basic_type, element);
+ Class node = new Class (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ get_private_cname (element),
+ get_class_macro_name (element),
+ get_type_macro_name (element),
+ get_is_type_macro_name (element),
+ get_type_cast_macro_name (element),
+ get_type_function_name (element),
+ get_class_type_macro_name (element),
+ get_is_class_type_macro_name (element),
+ Vala.GDBusModule.get_dbus_name (element),
+ get_ccode_type_id (element),
+ get_param_spec_function (element),
+ get_ref_function (element),
+ get_unref_function (element),
+ get_free_function_name (element),
+ get_finalize_function_name (element),
+ get_take_value_function (element),
+ get_get_value_function (element),
+ get_set_value_function (element),
+ element.is_fundamental (),
+ element.is_abstract,
+ is_basic_type,
+ element);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Interface node = new Interface (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), get_type_macro_name (element), get_is_type_macro_name (element), get_type_cast_macro_name (element), get_type_function_name (element), get_interface_macro_name (element), Vala.GDBusModule.get_dbus_name (element), element);
+ Interface node = new Interface (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ get_type_macro_name (element),
+ get_is_type_macro_name (element),
+ get_type_cast_macro_name (element),
+ get_type_function_name (element),
+ get_interface_macro_name (element),
+ Vala.GDBusModule.get_dbus_name (element),
+element);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- bool is_basic_type = element.base_type == null && (element.is_boolean_type () || element.is_floating_type () || element.is_integer_type ());
-
- Struct node = new Struct (parent, file, element.name, get_access_modifier (element), comment, get_cname (element), get_type_macro_name (element), get_type_function_name (element), get_ccode_type_id (element), get_dup_function (element), get_copy_function (element), get_destroy_function (element), get_free_function (element), is_basic_type, element);
+ bool is_basic_type = element.base_type == null
+ && (element.is_boolean_type ()
+ || element.is_floating_type ()
+ || element.is_integer_type ());
+
+ Struct node = new Struct (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ get_type_macro_name (element),
+ get_type_function_name (element),
+ get_ccode_type_id (element),
+ get_dup_function (element),
+ get_copy_function (element),
+ get_destroy_function (element),
+ get_free_function (element),
+ is_basic_type,
+ element);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Field node = new Field (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), element.binding == Vala.MemberBinding.STATIC, element.is_volatile, element);
+ Field node = new Field (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ element.binding == Vala.MemberBinding.STATIC,
+ element.is_volatile,
+ element);
node.field_type = create_type_reference (element.variable_type, node, node);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Property node = new Property (parent, file, element.name, get_access_modifier(element), comment, get_nick (element), Vala.GDBusModule.get_dbus_name_for_member (element), Vala.GDBusServerModule.is_dbus_visible (element), get_property_binding_type (element), element);
+ Property node = new Property (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_nick (element),
+ Vala.GDBusModule.get_dbus_name_for_member (element),
+ Vala.GDBusServerModule.is_dbus_visible (element),
+ get_property_binding_type (element),
+ element);
node.property_type = create_type_reference (element.property_type, node, node);
symbol_map.set (element, node);
parent.add_child (node);
// Process property type
if (element.get_accessor != null) {
var accessor = element.get_accessor;
- node.getter = new PropertyAccessor (node, file, element.name, get_access_modifier(accessor), get_cname (accessor), get_property_accessor_type (accessor), get_property_ownership (accessor), accessor);
+ node.getter = new PropertyAccessor (node,
+ file,
+ element.name,
+ get_access_modifier (accessor),
+ get_cname (accessor),
+ get_property_accessor_type (accessor),
+ get_property_ownership (accessor),
+ accessor);
}
if (element.set_accessor != null) {
var accessor = element.set_accessor;
- node.setter = new PropertyAccessor (node, file, element.name, get_access_modifier(accessor), get_cname (accessor), get_property_accessor_type (accessor), get_property_ownership (accessor), accessor);
+ node.setter = new PropertyAccessor (node,
+ file,
+ element.name,
+ get_access_modifier (accessor),
+ get_cname (accessor),
+ get_property_accessor_type (accessor),
+ get_property_ownership (accessor),
+ accessor);
}
process_attributes (node, element.attributes);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Method node = new Method (parent, file, get_method_name (element), get_access_modifier(element), comment, get_cname (element), Vala.GDBusModule.get_dbus_name_for_member (element), Vala.GDBusServerModule.dbus_result_name (element), (element.coroutine)? get_finish_name (element) : null, get_method_binding_type (element), element.coroutine, Vala.GDBusServerModule.is_dbus_visible (element), element is Vala.CreationMethod, element);
+ Method node = new Method (parent,
+ file,
+ get_method_name (element),
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ Vala.GDBusModule.get_dbus_name_for_member (element),
+ Vala.GDBusServerModule.dbus_result_name (element),
+ (element.coroutine)? get_finish_name (element) : null,
+ get_method_binding_type (element),
+ element.coroutine,
+ Vala.GDBusServerModule.is_dbus_visible (element),
+ element is Vala.CreationMethod,
+ element);
node.return_type = create_type_reference (element.return_type, node, node);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Method node = new Method (parent, file, get_method_name (element), get_access_modifier(element), comment, get_cname (element), Vala.GDBusModule.get_dbus_name_for_member (element), Vala.GDBusServerModule.dbus_result_name (element), (element.coroutine)? get_finish_name (element) : null, get_method_binding_type (element), element.coroutine, Vala.GDBusServerModule.is_dbus_visible (element), element is Vala.CreationMethod, element);
+ Method node = new Method (parent,
+ file,
+ get_method_name (element),
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ Vala.GDBusModule.get_dbus_name_for_member (element),
+ Vala.GDBusServerModule.dbus_result_name (element),
+ (element.coroutine)? get_finish_name (element) : null,
+ get_method_binding_type (element),
+ element.coroutine,
+ Vala.GDBusServerModule.is_dbus_visible (element),
+ element is Vala.CreationMethod,
+ element);
node.return_type = create_type_reference (element.return_type, node, node);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Api.Signal node = new Api.Signal (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), Vala.GDBusModule.get_dbus_name_for_member (element), Vala.GDBusServerModule.is_dbus_visible (element), element.is_virtual, element);
+ Api.Signal node = new Api.Signal (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ Vala.GDBusModule.get_dbus_name_for_member (element),
+ Vala.GDBusServerModule.is_dbus_visible (element),
+ element.is_virtual,
+ element);
node.return_type = create_type_reference (element.return_type, node, node);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Delegate node = new Delegate (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), !element.has_target, element);
+ Delegate node = new Delegate (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ !element.has_target,
+ element);
node.return_type = create_type_reference (element.return_type, node, node);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Symbol node = new Enum (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), get_type_macro_name (element), get_type_function_name (element), element);
+ Symbol node = new Enum (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ get_type_macro_name (element),
+ get_type_function_name (element),
+ element);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Symbol node = new Api.EnumValue (parent, file, element.name, comment, get_cname (element), element);
+ Symbol node = new Api.EnumValue (parent,
+ file,
+ element.name,
+ comment,
+ get_cname (element),
+ element);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Constant node = new Constant (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), element);
+ Constant node = new Constant (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ element);
node.constant_type = create_type_reference (element.type_reference, node, node);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Symbol node = new ErrorDomain (parent, file, element.name, get_access_modifier (element), comment, get_cname (element), get_quark_macro_name (element), get_quark_function_name (element), Vala.GDBusModule.get_dbus_name (element), element);
+ Symbol node = new ErrorDomain (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ get_quark_macro_name (element),
+ get_quark_function_name (element),
+ Vala.GDBusModule.get_dbus_name (element),
+ element);
symbol_map.set (element, node);
parent.add_child (node);
SourceComment? comment = create_comment (element.comment);
- Symbol node = new Api.ErrorCode (parent, file, element.name, comment, get_cname (element), Vala.GDBusModule.get_dbus_name_for_member (element), element);
+ Symbol node = new Api.ErrorCode (parent,
+ file,
+ element.name,
+ comment,
+ get_cname (element),
+ Vala.GDBusModule.get_dbus_name_for_member (element),
+ element);
symbol_map.set (element, node);
parent.add_child (node);
Api.Node parent = get_parent_node_for (element);
SourceFile? file = get_source_file (element);
- FormalParameter node = new FormalParameter (parent, file, element.name, get_access_modifier(element), get_formal_parameter_type (element), element.ellipsis, element);
+ FormalParameter node = new FormalParameter (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ get_formal_parameter_type (element),
+ element.ellipsis,
+ element);
node.parameter_type = create_type_reference (element.variable_type, node, node);
parent.add_child (node);
// TODO: Register all packages here
// register packages included by gir-files
foreach (Vala.SourceFile vfile in context.get_source_files ()) {
- if (vfile.file_type == Vala.SourceFileType.PACKAGE && vfile.get_nodes ().size > 0 && files.contains (vfile) == false) {
+ if (vfile.file_type == Vala.SourceFileType.PACKAGE
+ && vfile.get_nodes ().size > 0
+ && files.contains (vfile) == false)
+ {
Package vdpkg = new Package (get_package_name (vfile.filename), true, null);
register_source_file (register_package (vdpkg), vfile);
}
gir_directory = settings.gir_directory;
}
- gir_writer.write_file ((Vala.CodeContext) tree.data, gir_directory, settings.gir_namespace, settings.gir_version, settings.pkg_name);
+ gir_writer.write_file ((Vala.CodeContext) tree.data,
+ gir_directory,
+ settings.gir_namespace,
+ settings.gir_version,
+ settings.pkg_name);
}
public Api.Tree? build (Settings settings, ErrorReporter reporter) {
Vala.SourceReference pos = c.source_reference;
if (c is Vala.GirComment) {
#if VALA_0_17_0
- comment = new GirSourceComment (c.content, file, pos.first_line, pos.first_column, pos.last_line, pos.last_column);
+ comment = new GirSourceComment (c.content,
+ file,
+ pos.first_line,
+ pos.first_column,
+ pos.last_line,
+ pos.last_column);
#else
- comment = new GirSourceComment (c.content, file, pos.begin.line, pos.begin.column, pos.end.line, pos.end.column);
+ comment = new GirSourceComment (c.content,
+ file,
+ pos.begin.line,
+ pos.begin.column,
+ pos.end.line,
+ pos.end.column);
#endif
} else {
#if VALA_0_17_0
- comment = new SourceComment (c.content, file, pos.first_line, pos.first_column, pos.last_line, pos.last_column);
+ comment = new SourceComment (c.content,
+ file,
+ pos.first_line,
+ pos.first_column,
+ pos.last_line,
+ pos.last_column);
#else
- comment = new SourceComment (c.content, file, pos.begin.line, pos.begin.column, pos.end.line, pos.end.column);
+ comment = new SourceComment (c.content,
+ file,
+ pos.begin.line,
+ pos.begin.column,
+ pos.end.line,
+ pos.end.column);
#endif
}
break;
}
private TypeReference create_type_reference (Vala.DataType? vtyperef, Item parent, Api.Node caller) {
- bool is_nullable = vtyperef != null && vtyperef.nullable && !(vtyperef is Vala.GenericType) && !(vtyperef is Vala.PointerType);
- string? signature = (vtyperef != null && vtyperef.data_type != null)? Vala.GVariantModule.get_dbus_signature (vtyperef.data_type) : null;
+ bool is_nullable = vtyperef != null
+ && vtyperef.nullable
+ && !(vtyperef is Vala.GenericType)
+ && !(vtyperef is Vala.PointerType);
+ string? signature = (vtyperef != null
+ && vtyperef.data_type != null) ? Vala.GVariantModule.get_dbus_signature (vtyperef.data_type) : null;
bool pass_ownership = type_reference_pass_ownership (vtyperef);
Ownership ownership = get_type_reference_ownership (vtyperef);
bool is_dynamic = vtyperef != null && vtyperef.is_dynamic;
- TypeReference type_ref = new TypeReference (parent, ownership, pass_ownership, is_dynamic, is_nullable, signature, vtyperef);
+ TypeReference type_ref = new TypeReference (parent,
+ ownership,
+ pass_ownership,
+ is_dynamic,
+ is_nullable,
+ signature,
+ vtyperef);
if (vtyperef is Vala.PointerType) {
type_ref.data_type = create_pointer ((Vala.PointerType) vtyperef, type_ref, caller);
} else if (vtyperef is Vala.ArrayType) {
type_ref.data_type = create_array ((Vala.ArrayType) vtyperef, type_ref, caller);
//} else if (vtyperef is Vala.GenericType) {
- // type_ref.data_type = new TypeParameter (caller, caller.get_source_file (), ((Vala.GenericType) vtyperef).type_parameter.name, vtyperef);
+ // type_ref.data_type = new TypeParameter (caller,
+ // caller.get_source_file (),
+ // ((Vala.GenericType) vtyperef).type_parameter.name,
+ // vtyperef);
}
// type parameters:
SourceFile file = files.get (pos.file);
if (comment is Vala.GirComment) {
#if VALA_0_17_0
- var tmp = new GirSourceComment (comment.content, file, pos.first_line, pos.first_column, pos.last_line, pos.last_column);
+ var tmp = new GirSourceComment (comment.content,
+ file,
+ pos.first_line,
+ pos.first_column,
+ pos.last_line,
+ pos.last_column);
#else
- var tmp = new GirSourceComment (comment.content, file, pos.begin.line, pos.begin.column, pos.end.line, pos.end.column);
+ var tmp = new GirSourceComment (comment.content,
+ file,
+ pos.begin.line,
+ pos.begin.column,
+ pos.end.line,
+ pos.end.column);
#endif
if (((Vala.GirComment) comment).return_content != null) {
Vala.SourceReference return_pos = ((Vala.GirComment) comment).return_content.source_reference;
#if VALA_0_17_0
- tmp.return_comment = new SourceComment (((Vala.GirComment) comment).return_content.content, file, return_pos.first_line, return_pos.first_column, return_pos.last_line, return_pos.last_column);
+ tmp.return_comment = new SourceComment (((Vala.GirComment) comment).return_content.content,
+ file,
+ return_pos.first_line,
+ return_pos.first_column,
+ return_pos.last_line,
+ return_pos.last_column);
#else
- tmp.return_comment = new SourceComment (((Vala.GirComment) comment).return_content.content, file, return_pos.begin.line, return_pos.begin.column, return_pos.end.line, return_pos.end.column);
+ tmp.return_comment = new SourceComment (((Vala.GirComment) comment).return_content.content,
+ file,
+ return_pos.begin.line,
+ return_pos.begin.column,
+ return_pos.end.line,
+ return_pos.end.column);
#endif
}
Vala.Comment vala_param = it.get_value ();
Vala.SourceReference param_pos = vala_param.source_reference;
#if VALA_0_17_0
- var param_comment = new SourceComment (vala_param.content, file, param_pos.first_line, param_pos.first_column, param_pos.last_line, param_pos.last_column);
+ var param_comment = new SourceComment (vala_param.content,
+ file,
+ param_pos.first_line,
+ param_pos.first_column,
+ param_pos.last_line,
+ param_pos.last_column);
#else
- var param_comment = new SourceComment (vala_param.content, file, param_pos.begin.line, param_pos.begin.column, param_pos.end.line, param_pos.end.column);
+ var param_comment = new SourceComment (vala_param.content,
+ file,
+ param_pos.begin.line,
+ param_pos.begin.column,
+ param_pos.end.line,
+ param_pos.end.column);
#endif
tmp.add_parameter_content (it.get_key (), param_comment);
}
return tmp;
} else {
#if VALA_0_17_0
- return new SourceComment (comment.content, file, pos.first_line, pos.first_column, pos.last_line, pos.last_column);
+ return new SourceComment (comment.content,
+ file,
+ pos.first_line,
+ pos.first_column,
+ pos.last_line,
+ pos.last_column);
#else
- return new SourceComment (comment.content, file, pos.begin.line, pos.begin.column, pos.end.line, pos.end.column);
+ return new SourceComment (comment.content,
+ file,
+ pos.begin.line,
+ pos.begin.column,
+ pos.end.line,
+ pos.end.column);
#endif
}
}
}
private string? get_type_function_name (Vala.TypeSymbol element) {
- if ((element is Vala.Class && ((Vala.Class) element).is_compact) || element is Vala.ErrorDomain || element is Vala.Delegate) {
+ if ((element is Vala.Class && ((Vala.Class) element).is_compact)
+ || element is Vala.ErrorDomain
+ || element is Vala.Delegate)
+ {
return null;
}
}
private string? get_type_macro_name (Vala.TypeSymbol element) {
- if ((element is Vala.Class && ((Vala.Class) element).is_compact) || element is Vala.ErrorDomain || element is Vala.Delegate) {
+ if ((element is Vala.Class && ((Vala.Class) element).is_compact)
+ || element is Vala.ErrorDomain
+ || element is Vala.Delegate)
+ {
return null;
}
}
private SourceFile register_source_file (PackageMetaData meta_data, Vala.SourceFile source_file) {
- SourceFile file = new SourceFile (meta_data.package, source_file.get_relative_filename (), source_file.get_csource_filename (), source_file);
+ SourceFile file = new SourceFile (meta_data.package,
+ source_file.get_relative_filename (),
+ source_file.get_csource_filename (),
+ source_file);
files.set (source_file, file);
meta_data.register_source_file (source_file);
}
// non ref counted types are weak, not unowned
- if (element.data_type is Vala.TypeSymbol && is_reference_counting ((Vala.TypeSymbol) element.data_type) == true) {
+ if (element.data_type is Vala.TypeSymbol &&
+ is_reference_counting ((Vala.TypeSymbol) element.data_type) == true)
+ {
return false;
}
}
// non ref counted types are unowned, not weak
- if (element.data_type is Vala.TypeSymbol && is_reference_counting ((Vala.TypeSymbol) element.data_type) == false) {
+ if (element.data_type is Vala.TypeSymbol
+ && is_reference_counting ((Vala.TypeSymbol) element.data_type) == false)
+ {
return false;
}
// add default packages:
- if (settings.profile == "gobject-2.0" || settings.profile == "gobject" || settings.profile == null) {
+ if (settings.profile == "gobject-2.0"
+ || settings.profile == "gobject"
+ || settings.profile == null)
+ {
context.profile = Vala.Profile.GOBJECT;
context.add_define ("GOBJECT");
}
Vala.Report.error (null, "This version of valac only supports GLib 2");
}
- if (settings.target_glib != null && settings.target_glib.scanf ("%d.%d", out glib_major, out glib_minor) != 2) {
+ if (settings.target_glib != null
+ && settings.target_glib.scanf ("%d.%d", out glib_major, out glib_minor) != 2)
+ {
Vala.Report.error (null, "Invalid format for --target-glib");
}
bool is_basic_type = element.base_class == null && element.name == "string";
- Class node = new Class (parent, file, element.name, get_access_modifier (element), comment, get_cname (element), get_private_cname (element), get_class_macro_name (element), get_type_macro_name (element), get_is_type_macro_name (element), get_type_cast_macro_name (element), get_type_function_name (element), get_class_type_macro_name (element), get_is_class_type_macro_name (element), Vala.GDBusModule.get_dbus_name (element), get_ccode_type_id (element), get_param_spec_function (element), get_ref_function (element), get_unref_function (element), get_free_function_name (element), get_finalize_function_name (element), get_take_value_function (element), get_get_value_function (element), get_set_value_function (element), element.is_fundamental (), element.is_abstract, is_basic_type, element);
+ Class node = new Class (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ get_private_cname (element),
+ get_class_macro_name (element),
+ get_type_macro_name (element),
+ get_is_type_macro_name (element),
+ get_type_cast_macro_name (element),
+ get_type_function_name (element),
+ get_class_type_macro_name (element),
+ get_is_class_type_macro_name (element),
+ Vala.GDBusModule.get_dbus_name (element),
+ get_ccode_type_id (element),
+ get_param_spec_function (element),
+ get_ref_function (element),
+ get_unref_function (element),
+ get_free_function_name (element),
+ get_finalize_function_name (element),
+ get_take_value_function (element),
+ get_get_value_function (element),
+ get_set_value_function (element),
+ element.is_fundamental (),
+ element.is_abstract,
+ is_basic_type,
+ element);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Interface node = new Interface (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), get_type_macro_name (element), get_is_type_macro_name (element), get_type_cast_macro_name (element), get_type_function_name (element), get_interface_macro_name (element), Vala.GDBusModule.get_dbus_name (element), element);
+ Interface node = new Interface (parent,
+ file,
+ element.name,
+ get_access_modifier(element),
+ comment,
+ get_cname (element),
+ get_type_macro_name (element),
+ get_is_type_macro_name (element),
+ get_type_cast_macro_name (element),
+ get_type_function_name (element),
+ get_interface_macro_name (element),
+ Vala.GDBusModule.get_dbus_name (element),
+ element);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- bool is_basic_type = element.base_type == null && (element.is_boolean_type () || element.is_floating_type () || element.is_integer_type ());
-
- Struct node = new Struct (parent, file, element.name, get_access_modifier (element), comment, get_cname (element), get_type_macro_name (element), get_type_function_name (element), get_ccode_type_id (element), get_dup_function (element), get_copy_function (element), get_destroy_function (element), get_free_function (element), is_basic_type, element);
+ bool is_basic_type = element.base_type == null
+ && (element.is_boolean_type ()
+ || element.is_floating_type ()
+ || element.is_integer_type ());
+
+ Struct node = new Struct (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ get_type_macro_name (element),
+ get_type_function_name (element),
+ get_ccode_type_id (element),
+ get_dup_function (element),
+ get_copy_function (element),
+ get_destroy_function (element),
+ get_free_function (element),
+ is_basic_type,
+ element);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Field node = new Field (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), element.binding == Vala.MemberBinding.STATIC, element.is_volatile, element);
+ Field node = new Field (parent,
+ file,
+ element.name,
+ get_access_modifier(element),
+ comment,
+ get_cname (element),
+ element.binding == Vala.MemberBinding.STATIC,
+ element.is_volatile,
+ element);
node.field_type = create_type_reference (element.variable_type, node, node);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Property node = new Property (parent, file, element.name, get_access_modifier(element), comment, get_nick (element), Vala.GDBusModule.get_dbus_name_for_member (element), Vala.GDBusServerModule.is_dbus_visible (element), get_property_binding_type (element), element);
+ Property node = new Property (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_nick (element),
+ Vala.GDBusModule.get_dbus_name_for_member (element),
+ Vala.GDBusServerModule.is_dbus_visible (element),
+ get_property_binding_type (element),
+ element);
node.property_type = create_type_reference (element.property_type, node, node);
symbol_map.set (element, node);
parent.add_child (node);
// Process property type
if (element.get_accessor != null) {
var accessor = element.get_accessor;
- node.getter = new PropertyAccessor (node, file, element.name, get_access_modifier (accessor), get_cname (accessor), get_property_accessor_type (accessor), get_property_ownership (accessor), accessor);
+ node.getter = new PropertyAccessor (node,
+ file,
+ element.name,
+ get_access_modifier (accessor),
+ get_cname (accessor),
+ get_property_accessor_type (accessor),
+ get_property_ownership (accessor),
+ accessor);
}
if (element.set_accessor != null) {
var accessor = element.set_accessor;
- node.setter = new PropertyAccessor (node, file, element.name, get_access_modifier (accessor), get_cname (accessor), get_property_accessor_type (accessor), get_property_ownership (accessor), accessor);
+ node.setter = new PropertyAccessor (node,
+ file,
+ element.name,
+ get_access_modifier (accessor),
+ get_cname (accessor),
+ get_property_accessor_type (accessor),
+ get_property_ownership (accessor),
+ accessor);
}
process_attributes (node, element.attributes);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Method node = new Method (parent, file, get_method_name (element), get_access_modifier(element), comment, get_cname (element), Vala.GDBusModule.get_dbus_name_for_member (element), Vala.GDBusServerModule.dbus_result_name (element), (element.coroutine)? get_finish_name (element) : null, get_method_binding_type (element), element.coroutine, Vala.GDBusServerModule.is_dbus_visible (element), element is Vala.CreationMethod, element);
+ Method node = new Method (parent,
+ file,
+ get_method_name (element),
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ Vala.GDBusModule.get_dbus_name_for_member (element),
+ Vala.GDBusServerModule.dbus_result_name (element),
+ (element.coroutine)? get_finish_name (element) : null,
+ get_method_binding_type (element),
+ element.coroutine,
+ Vala.GDBusServerModule.is_dbus_visible (element),
+ element is Vala.CreationMethod,
+ element);
node.return_type = create_type_reference (element.return_type, node, node);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Method node = new Method (parent, file, get_method_name (element), get_access_modifier(element), comment, get_cname (element), Vala.GDBusModule.get_dbus_name_for_member (element), Vala.GDBusServerModule.dbus_result_name (element), (element.coroutine)? get_finish_name (element) : null, get_method_binding_type (element), element.coroutine, Vala.GDBusServerModule.is_dbus_visible (element), element is Vala.CreationMethod, element);
+ Method node = new Method (parent,
+ file,
+ get_method_name (element),
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ Vala.GDBusModule.get_dbus_name_for_member (element),
+ Vala.GDBusServerModule.dbus_result_name (element),
+ (element.coroutine)? get_finish_name (element) : null,
+ get_method_binding_type (element),
+ element.coroutine,
+ Vala.GDBusServerModule.is_dbus_visible (element),
+ element is Vala.CreationMethod,
+ element);
node.return_type = create_type_reference (element.return_type, node, node);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Api.Signal node = new Api.Signal (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), Vala.GDBusModule.get_dbus_name_for_member (element), Vala.GDBusServerModule.is_dbus_visible (element), element.is_virtual, element);
+ Api.Signal node = new Api.Signal (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ Vala.GDBusModule.get_dbus_name_for_member (element),
+ Vala.GDBusServerModule.is_dbus_visible (element),
+ element.is_virtual,
+ element);
node.return_type = create_type_reference (element.return_type, node, node);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Delegate node = new Delegate (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), !element.has_target, element);
+ Delegate node = new Delegate (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ !element.has_target,
+ element);
node.return_type = create_type_reference (element.return_type, node, node);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Symbol node = new Enum (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), get_type_macro_name (element), get_type_function_name (element), element);
+ Symbol node = new Enum (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ get_type_macro_name (element),
+ get_type_function_name (element),
+ element);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Symbol node = new Api.EnumValue (parent, file, element.name, comment, get_cname (element), element);
+ Symbol node = new Api.EnumValue (parent,
+ file,
+ element.name,
+ comment,
+ get_cname (element),
+ element);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Constant node = new Constant (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), element);
+ Constant node = new Constant (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ element);
node.constant_type = create_type_reference (element.type_reference, node, node);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Symbol node = new ErrorDomain (parent, file, element.name, get_access_modifier (element), comment, get_cname (element), get_quark_macro_name (element), get_quark_function_name (element), Vala.GDBusModule.get_dbus_name (element), element);
+ Symbol node = new ErrorDomain (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ get_quark_macro_name (element),
+ get_quark_function_name (element),
+ Vala.GDBusModule.get_dbus_name (element),
+ element);
symbol_map.set (element, node);
parent.add_child (node);
SourceComment? comment = create_comment (element.comment);
- Symbol node = new Api.ErrorCode (parent, file, element.name, comment, get_cname (element), Vala.GDBusModule.get_dbus_name_for_member (element), element);
+ Symbol node = new Api.ErrorCode (parent,
+ file,
+ element.name,
+ comment,
+ get_cname (element),
+ Vala.GDBusModule.get_dbus_name_for_member (element),
+ element);
symbol_map.set (element, node);
parent.add_child (node);
Api.Node parent = get_parent_node_for (element);
SourceFile? file = get_source_file (element);
- FormalParameter node = new FormalParameter (parent, file, element.name, get_access_modifier(element), get_formal_parameter_type (element), element.ellipsis, element);
+ FormalParameter node = new FormalParameter (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ get_formal_parameter_type (element),
+ element.ellipsis,
+ element);
node.parameter_type = create_type_reference (element.variable_type, node, node);
parent.add_child (node);
// TODO: Register all packages here
// register packages included by gir-files
foreach (Vala.SourceFile vfile in context.get_source_files ()) {
- if (vfile.file_type == Vala.SourceFileType.PACKAGE && vfile.get_nodes ().size > 0 && files.contains (vfile) == false) {
+ if (vfile.file_type == Vala.SourceFileType.PACKAGE
+ && vfile.get_nodes ().size > 0
+ && files.contains (vfile) == false)
+ {
Package vdpkg = new Package (get_package_name (vfile.filename), true, null);
register_source_file (register_package (vdpkg), vfile);
}
gir_directory = settings.gir_directory;
}
- gir_writer.write_file ((Vala.CodeContext) tree.data, gir_directory, settings.gir_namespace, settings.gir_version, settings.pkg_name);
+ gir_writer.write_file ((Vala.CodeContext) tree.data,
+ gir_directory,
+ settings.gir_namespace,
+ settings.gir_version,
+ settings.pkg_name);
}
public Api.Tree? build (Settings settings, ErrorReporter reporter) {
) {
Vala.SourceReference pos = c.source_reference;
if (c is Vala.GirComment) {
- comment = new GirSourceComment (c.content, file, pos.begin.line, pos.begin.column, pos.end.line, pos.end.column);
+ comment = new GirSourceComment (c.content,
+ file,
+ pos.begin.line,
+ pos.begin.column,
+ pos.end.line,
+ pos.end.column);
} else {
- comment = new SourceComment (c.content, file, pos.begin.line, pos.begin.column, pos.end.line, pos.end.column);
+ comment = new SourceComment (c.content,
+ file,
+ pos.begin.line,
+ pos.begin.column,
+ pos.end.line,
+ pos.end.column);
}
break;
}
}
private TypeReference create_type_reference (Vala.DataType? vtyperef, Item parent, Api.Node caller) {
- bool is_nullable = vtyperef != null && vtyperef.nullable && !(vtyperef is Vala.GenericType) && !(vtyperef is Vala.PointerType);
- string? signature = (vtyperef != null && vtyperef.data_type != null)? Vala.GVariantModule.get_dbus_signature (vtyperef.data_type) : null;
+ bool is_nullable = vtyperef != null
+ && vtyperef.nullable
+ && !(vtyperef is Vala.GenericType)
+ && !(vtyperef is Vala.PointerType);
+ string? signature = (vtyperef != null
+ && vtyperef.data_type != null)? Vala.GVariantModule.get_dbus_signature (vtyperef.data_type) : null;
bool pass_ownership = type_reference_pass_ownership (vtyperef);
Ownership ownership = get_type_reference_ownership (vtyperef);
bool is_dynamic = vtyperef != null && vtyperef.is_dynamic;
- TypeReference type_ref = new TypeReference (parent, ownership, pass_ownership, is_dynamic, is_nullable, signature, vtyperef);
+ TypeReference type_ref = new TypeReference (parent,
+ ownership,
+ pass_ownership,
+ is_dynamic,
+ is_nullable,
+ signature,
+ vtyperef);
if (vtyperef is Vala.PointerType) {
type_ref.data_type = create_pointer ((Vala.PointerType) vtyperef, type_ref, caller);
} else if (vtyperef is Vala.ArrayType) {
type_ref.data_type = create_array ((Vala.ArrayType) vtyperef, type_ref, caller);
//} else if (vtyperef is Vala.GenericType) {
- // type_ref.data_type = new TypeParameter (caller, caller.get_source_file (), ((Vala.GenericType) vtyperef).type_parameter.name, vtyperef);
+ // type_ref.data_type = new TypeParameter (caller,
+ // caller.get_source_file (),
+ // ((Vala.GenericType) vtyperef).type_parameter.name,
+ // vtyperef);
}
// type parameters:
Vala.SourceReference pos = comment.source_reference;
SourceFile file = files.get (pos.file);
if (comment is Vala.GirComment) {
- var tmp = new GirSourceComment (comment.content, file, pos.begin.line, pos.begin.column, pos.end.line, pos.end.column);
+ var tmp = new GirSourceComment (comment.content,
+ file,
+ pos.begin.line,
+ pos.begin.column,
+ pos.end.line,
+ pos.end.column);
if (((Vala.GirComment) comment).return_content != null) {
Vala.SourceReference return_pos = ((Vala.GirComment) comment).return_content.source_reference;
- tmp.return_comment = new SourceComment (((Vala.GirComment) comment).return_content.content, file, return_pos.begin.line, return_pos.begin.column, return_pos.end.line, return_pos.end.column);
+ tmp.return_comment = new SourceComment (((Vala.GirComment) comment).return_content.content,
+ file,
+ return_pos.begin.line,
+ return_pos.begin.column,
+ return_pos.end.line,
+ return_pos.end.column);
}
Vala.MapIterator<string, Vala.Comment> it = ((Vala.GirComment) comment).parameter_iterator ();
while (it.next ()) {
Vala.Comment vala_param = it.get_value ();
Vala.SourceReference param_pos = vala_param.source_reference;
- var param_comment = new SourceComment (vala_param.content, file, param_pos.begin.line, param_pos.begin.column, param_pos.end.line, param_pos.end.column);
+ var param_comment = new SourceComment (vala_param.content,
+ file,
+ param_pos.begin.line,
+ param_pos.begin.column,
+ param_pos.end.line,
+ param_pos.end.column);
tmp.add_parameter_content (it.get_key (), param_comment);
}
return tmp;
} else {
- return new SourceComment (comment.content, file, pos.begin.line, pos.begin.column, pos.end.line, pos.end.column);
+ return new SourceComment (comment.content,
+ file,
+ pos.begin.line,
+ pos.begin.column,
+ pos.end.line,
+ pos.end.column);
}
}
}
private string? get_type_function_name (Vala.TypeSymbol element) {
- if ((element is Vala.Class && ((Vala.Class) element).is_compact) || element is Vala.ErrorDomain || element is Vala.Delegate) {
+ if ((element is Vala.Class
+ && ((Vala.Class) element).is_compact)
+ || element is Vala.ErrorDomain
+ || element is Vala.Delegate)
+ {
return null;
}
}
private string? get_type_macro_name (Vala.TypeSymbol element) {
- if ((element is Vala.Class && ((Vala.Class) element).is_compact) || element is Vala.ErrorDomain || element is Vala.Delegate) {
+ if ((element is Vala.Class
+ && ((Vala.Class) element).is_compact)
+ || element is Vala.ErrorDomain
+ || element is Vala.Delegate)
+ {
return null;
}
}
private string? get_type_cast_macro_name (Vala.TypeSymbol element) {
- if ((element is Vala.Class && !((Vala.Class) element).is_compact) || element is Vala.Interface) {
+ if ((element is Vala.Class
+ && !((Vala.Class) element).is_compact)
+ || element is Vala.Interface)
+ {
return Vala.CCodeBaseModule.get_ccode_upper_case_name (element, null);
} else {
return null;
}
private SourceFile register_source_file (PackageMetaData meta_data, Vala.SourceFile source_file) {
- SourceFile file = new SourceFile (meta_data.package, source_file.get_relative_filename (), source_file.get_csource_filename (), source_file);
+ SourceFile file = new SourceFile (meta_data.package,
+ source_file.get_relative_filename (),
+ source_file.get_csource_filename (),
+ source_file);
files.set (source_file, file);
meta_data.register_source_file (source_file);
}
// non ref counted types are weak, not unowned
- if (element.data_type is Vala.TypeSymbol && is_reference_counting ((Vala.TypeSymbol) element.data_type) == true) {
+ if (element.data_type is Vala.TypeSymbol
+ && is_reference_counting ((Vala.TypeSymbol) element.data_type) == true)
+ {
return false;
}
// FormalParameters are weak by default
- return (element.parent_node is Vala.Parameter == false)? element.is_weak () : false;
+ return (element.parent_node is Vala.Parameter == false)
+ ? element.is_weak ()
+ : false;
}
private bool is_type_reference_owned (Vala.DataType? element) {
}
// non ref counted types are unowned, not weak
- if (element.data_type is Vala.TypeSymbol && is_reference_counting ((Vala.TypeSymbol) element.data_type) == false) {
+ if (element.data_type is Vala.TypeSymbol
+ && is_reference_counting ((Vala.TypeSymbol) element.data_type) == false)
+ {
return false;
}
bool is_basic_type = element.base_class == null && element.name == "string";
- Class node = new Class (parent, file, element.name, get_access_modifier (element), comment, get_cname (element), get_private_cname (element), get_class_macro_name (element), get_type_macro_name (element), get_is_type_macro_name (element), get_type_cast_macro_name (element), get_type_function_name (element), get_class_type_macro_name (element), get_is_class_type_macro_name (element), Vala.GDBusModule.get_dbus_name (element), get_ccode_type_id (element), get_param_spec_function (element), get_ref_function (element), get_unref_function (element), get_free_function_name (element), get_finalize_function_name (element), get_take_value_function (element), get_get_value_function (element), get_set_value_function (element), element.is_fundamental (), element.is_abstract, is_basic_type, element);
+ Class node = new Class (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ get_private_cname (element),
+ get_class_macro_name (element),
+ get_type_macro_name (element),
+ get_is_type_macro_name (element),
+ get_type_cast_macro_name (element),
+ get_type_function_name (element),
+ get_class_type_macro_name (element),
+ get_is_class_type_macro_name (element),
+ Vala.GDBusModule.get_dbus_name (element),
+ get_ccode_type_id (element),
+ get_param_spec_function (element),
+ get_ref_function (element),
+ get_unref_function (element),
+ get_free_function_name (element),
+ get_finalize_function_name (element),
+ get_take_value_function (element),
+ get_get_value_function (element),
+ get_set_value_function (element),
+ element.is_fundamental (),
+ element.is_abstract,
+ is_basic_type,
+ element);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Interface node = new Interface (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), get_type_macro_name (element), get_is_type_macro_name (element), get_type_cast_macro_name (element), get_type_function_name (element), get_interface_macro_name (element), Vala.GDBusModule.get_dbus_name (element), element);
+ Interface node = new Interface (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ get_type_macro_name (element),
+ get_is_type_macro_name (element),
+ get_type_cast_macro_name (element),
+ get_type_function_name (element),
+ get_interface_macro_name (element),
+ Vala.GDBusModule.get_dbus_name (element),
+ element);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- bool is_basic_type = element.base_type == null && (element.is_boolean_type () || element.is_floating_type () || element.is_integer_type ());
-
- Struct node = new Struct (parent, file, element.name, get_access_modifier (element), comment, get_cname (element), get_type_macro_name (element), get_type_function_name (element), get_ccode_type_id (element), get_dup_function (element), get_copy_function (element), get_destroy_function (element), get_free_function (element), is_basic_type, element);
+ bool is_basic_type = element.base_type == null
+ && (element.is_boolean_type ()
+ || element.is_floating_type ()
+ || element.is_integer_type ());
+
+ Struct node = new Struct (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ get_type_macro_name (element),
+ get_type_function_name (element),
+ get_ccode_type_id (element),
+ get_dup_function (element),
+ get_copy_function (element),
+ get_destroy_function (element),
+ get_free_function (element),
+ is_basic_type,
+ element);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Field node = new Field (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), element.binding == Vala.MemberBinding.STATIC, element.is_volatile, element);
+ Field node = new Field (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ element.binding == Vala.MemberBinding.STATIC,
+ element.is_volatile,
+ element);
node.field_type = create_type_reference (element.variable_type, node, node);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Property node = new Property (parent, file, element.name, get_access_modifier(element), comment, get_nick (element), Vala.GDBusModule.get_dbus_name_for_member (element), Vala.GDBusServerModule.is_dbus_visible (element), get_property_binding_type (element), element);
+ Property node = new Property (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_nick (element),
+ Vala.GDBusModule.get_dbus_name_for_member (element),
+ Vala.GDBusServerModule.is_dbus_visible (element),
+ get_property_binding_type (element),
+ element);
node.property_type = create_type_reference (element.property_type, node, node);
symbol_map.set (element, node);
parent.add_child (node);
// Process property type
if (element.get_accessor != null) {
var accessor = element.get_accessor;
- node.getter = new PropertyAccessor (node, file, element.name, get_access_modifier (accessor), get_cname (accessor), get_property_accessor_type (accessor), get_property_ownership (accessor), accessor);
+ node.getter = new PropertyAccessor (node,
+ file,
+ element.name,
+ get_access_modifier (accessor),
+ get_cname (accessor),
+ get_property_accessor_type (accessor),
+ get_property_ownership (accessor),
+ accessor);
}
if (element.set_accessor != null) {
var accessor = element.set_accessor;
- node.setter = new PropertyAccessor (node, file, element.name, get_access_modifier (accessor), get_cname (accessor), get_property_accessor_type (accessor), get_property_ownership (accessor), accessor);
+ node.setter = new PropertyAccessor (node,
+ file,
+ element.name,
+ get_access_modifier (accessor),
+ get_cname (accessor),
+ get_property_accessor_type (accessor),
+ get_property_ownership (accessor),
+ accessor);
}
process_attributes (node, element.attributes);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Method node = new Method (parent, file, get_method_name (element), get_access_modifier(element), comment, get_cname (element), Vala.GDBusModule.get_dbus_name_for_member (element), Vala.GDBusServerModule.dbus_result_name (element), (element.coroutine)? get_finish_name (element) : null, get_method_binding_type (element), element.coroutine, Vala.GDBusServerModule.is_dbus_visible (element), element is Vala.CreationMethod, element);
+ Method node = new Method (parent,
+ file,
+ get_method_name (element),
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ Vala.GDBusModule.get_dbus_name_for_member (element),
+ Vala.GDBusServerModule.dbus_result_name (element),
+ (element.coroutine)? get_finish_name (element) : null,
+ get_method_binding_type (element),
+ element.coroutine,
+ Vala.GDBusServerModule.is_dbus_visible (element),
+ element is Vala.CreationMethod,
+ element);
node.return_type = create_type_reference (element.return_type, node, node);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Method node = new Method (parent, file, get_method_name (element), get_access_modifier(element), comment, get_cname (element), Vala.GDBusModule.get_dbus_name_for_member (element), Vala.GDBusServerModule.dbus_result_name (element), (element.coroutine)? get_finish_name (element) : null, get_method_binding_type (element), element.coroutine, Vala.GDBusServerModule.is_dbus_visible (element), element is Vala.CreationMethod, element);
+ Method node = new Method (parent,
+ file,
+ get_method_name (element),
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ Vala.GDBusModule.get_dbus_name_for_member (element),
+ Vala.GDBusServerModule.dbus_result_name (element),
+ (element.coroutine)? get_finish_name (element) : null,
+ get_method_binding_type (element),
+ element.coroutine,
+ Vala.GDBusServerModule.is_dbus_visible (element),
+ element is Vala.CreationMethod,
+ element);
node.return_type = create_type_reference (element.return_type, node, node);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Api.Signal node = new Api.Signal (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), Vala.GDBusModule.get_dbus_name_for_member (element), Vala.GDBusServerModule.is_dbus_visible (element), element.is_virtual, element);
+ Api.Signal node = new Api.Signal (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ Vala.GDBusModule.get_dbus_name_for_member (element),
+ Vala.GDBusServerModule.is_dbus_visible (element),
+ element.is_virtual,
+ element);
node.return_type = create_type_reference (element.return_type, node, node);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Delegate node = new Delegate (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), !element.has_target, element);
+ Delegate node = new Delegate (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ !element.has_target,
+ element);
node.return_type = create_type_reference (element.return_type, node, node);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Symbol node = new Enum (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), get_type_macro_name (element), get_type_function_name (element), element);
+ Symbol node = new Enum (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ get_type_macro_name (element),
+ get_type_function_name (element),
+ element);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Symbol node = new Api.EnumValue (parent, file, element.name, comment, get_cname (element), element);
+ Symbol node = new Api.EnumValue (parent,
+ file,
+ element.name,
+ comment,
+ get_cname (element),
+ element);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Constant node = new Constant (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), element);
+ Constant node = new Constant (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ element);
node.constant_type = create_type_reference (element.type_reference, node, node);
symbol_map.set (element, node);
parent.add_child (node);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Symbol node = new ErrorDomain (parent, file, element.name, get_access_modifier (element), comment, get_cname (element), get_quark_macro_name (element), get_quark_function_name (element), Vala.GDBusModule.get_dbus_name (element), element);
+ Symbol node = new ErrorDomain (parent,
+ file,
+ element.name,
+ get_access_modifier (element),
+ comment,
+ get_cname (element),
+ get_quark_macro_name (element),
+ get_quark_function_name (element),
+ Vala.GDBusModule.get_dbus_name (element),
+ element);
symbol_map.set (element, node);
parent.add_child (node);
SourceComment? comment = create_comment (element.comment);
- Symbol node = new Api.ErrorCode (parent, file, element.name, comment, get_cname (element), Vala.GDBusModule.get_dbus_name_for_member (element), element);
+ Symbol node = new Api.ErrorCode (parent,
+ file,
+ element.name,
+ comment,
+ get_cname (element),
+ Vala.GDBusModule.get_dbus_name_for_member (element),
+ element);
symbol_map.set (element, node);
parent.add_child (node);
Api.Node parent = get_parent_node_for (element);
SourceFile? file = get_source_file (element);
- Symbol node = new TypeParameter (parent, file, element.name, element);
+ Symbol node = new TypeParameter (parent,
+ file,
+ element.name,
+ element);
symbol_map.set (element, node);
parent.add_child (node);
Api.Node parent = get_parent_node_for (element);
SourceFile? file = get_source_file (element);
- FormalParameter node = new FormalParameter (parent, file, element.name, get_access_modifier(element), get_formal_parameter_type (element), element.ellipsis, element);
+ FormalParameter node = new FormalParameter (parent,
+ file,
+ element.name,
+ get_access_modifier(element),
+ get_formal_parameter_type (element),
+ element.ellipsis,
+ element);
node.parameter_type = create_type_reference (element.variable_type, node, node);
parent.add_child (node);
// TODO: Register all packages here
// register packages included by gir-files
foreach (Vala.SourceFile vfile in context.get_source_files ()) {
- if (vfile.file_type == Vala.SourceFileType.PACKAGE && vfile.get_nodes ().size > 0 && files.contains (vfile) == false) {
+ if (vfile.file_type == Vala.SourceFileType.PACKAGE
+ && vfile.get_nodes ().size > 0
+ && files.contains (vfile) == false)
+ {
Package vdpkg = new Package (get_package_name (vfile.filename), true, null);
register_source_file (register_package (vdpkg), vfile);
}
private string? private_cname;
private string? cname;
- public Class (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? cname, string? private_cname, string? class_macro_name, string? type_macro_name, string? is_type_macro_name, string? type_cast_macro_name, string? type_function_name, string? class_type_macro_name, string? is_class_type_macro_name, string? dbus_name, string? type_id, string? param_spec_function_name, string? ref_function_name, string? unref_function_name, string? free_function_name, string? finalize_function_name, string? take_value_function_cname, string? get_value_function_cname, string? set_value_function_cname, bool is_fundamental, bool is_abstract, bool is_basic_type, void* data) {
- base (parent, file, name, accessibility, comment, type_macro_name, is_type_macro_name, type_cast_macro_name, type_function_name, is_basic_type, data);
+ public Class (Node parent, SourceFile file, string name, SymbolAccessibility accessibility,
+ SourceComment? comment, string? cname, string? private_cname, string? class_macro_name,
+ string? type_macro_name, string? is_type_macro_name, string? type_cast_macro_name,
+ string? type_function_name, string? class_type_macro_name, string? is_class_type_macro_name,
+ string? dbus_name, string? type_id, string? param_spec_function_name, string? ref_function_name,
+ string? unref_function_name, string? free_function_name, string? finalize_function_name,
+ string? take_value_function_cname, string? get_value_function_cname, string? set_value_function_cname,
+ bool is_fundamental, bool is_abstract, bool is_basic_type, void* data)
+ {
+ base (parent, file, name, accessibility, comment, type_macro_name,
+ is_type_macro_name, type_cast_macro_name, type_function_name, is_basic_type, data);
this.interfaces = new ArrayList<TypeReference> ();
get;
}
- public Constant (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? cname, void* data) {
+ public Constant (Node parent, SourceFile file, string name, SymbolAccessibility accessibility,
+ SourceComment? comment, string? cname, void* data)
+ {
base (parent, file, name, accessibility, comment, data);
this.cname = cname;
}
- public Delegate (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? cname, bool is_static, void* data) {
+ public Delegate (Node parent, SourceFile file, string name, SymbolAccessibility accessibility,
+ SourceComment? comment, string? cname, bool is_static, void* data)
+ {
base (parent, file, name, accessibility, comment, null, null, null, null, false, data);
this.is_static = is_static;
public class Valadoc.Api.Enum : TypeSymbol {
private string cname;
- public Enum (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? cname, string? type_macro_name, string? type_function_name, void* data) {
- base (parent, file, name, accessibility, comment, type_macro_name, null, null, type_function_name, false, data);
+ public Enum (Node parent, SourceFile file, string name, SymbolAccessibility accessibility,
+ SourceComment? comment, string? cname, string? type_macro_name,
+ string? type_function_name, void* data)
+ {
+ base (parent, file, name, accessibility, comment, type_macro_name, null, null,
+ type_function_name, false, data);
this.cname = cname;
}
private string? dbus_name;
private string? cname;
- public ErrorCode (ErrorDomain parent, SourceFile file, string name, SourceComment? comment, string? cname, string? dbus_name, void* data) {
+ public ErrorCode (ErrorDomain parent, SourceFile file, string name, SourceComment? comment,
+ string? cname, string? dbus_name, void* data)
+ {
base (parent, file, name, parent.accessibility, data);
this.source_comment = comment;
private string? dbus_name;
private string? cname;
- public ErrorDomain (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? cname, string? quark_macro_name, string? quark_function_name, string? dbus_name, void* data) {
+ public ErrorDomain (Node parent, SourceFile file, string name, SymbolAccessibility accessibility,
+ SourceComment? comment, string? cname, string? quark_macro_name,
+ string? quark_function_name, string? dbus_name, void* data)
+ {
base (parent, file, name, accessibility, comment, null, null, null, null, false, data);
this.quark_function_name = quark_function_name;
public class Valadoc.Api.Field : Member {
private string? cname;
- public Field (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? cname, bool is_static, bool is_volatile, void* data) {
+ public Field (Node parent, SourceFile file, string name, SymbolAccessibility accessibility,
+ SourceComment? comment, string? cname, bool is_static, bool is_volatile,
+ void* data)
+ {
base (parent, file, name, accessibility, comment, data);
this.is_static = !(parent is Namespace) && is_static;
private string? cname;
- public Interface (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? cname, string? type_macro_name, string? is_type_macro_name, string? type_cast_macro_name, string? type_function_name, string interface_macro_name, string? dbus_name, void* data) {
- base (parent, file, name, accessibility, comment, type_macro_name, is_type_macro_name, type_cast_macro_name, type_function_name, false, data);
+ public Interface (Node parent, SourceFile file, string name, SymbolAccessibility accessibility,
+ SourceComment? comment, string? cname, string? type_macro_name, string? is_type_macro_name,
+ string? type_cast_macro_name, string? type_function_name, string interface_macro_name,
+ string? dbus_name, void* data)
+ {
+ base (parent, file, name, accessibility, comment, type_macro_name, is_type_macro_name,
+ type_cast_macro_name, type_function_name, false, data);
this.interface_macro_name = interface_macro_name;
this.dbus_name = dbus_name;
public abstract class Valadoc.Api.Member : Symbol {
private SourceComment? source_comment;
- public Member (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, void* data) {
+ public Member (Node parent, SourceFile file, string name, SymbolAccessibility accessibility,
+ SourceComment? comment, void* data)
+ {
base (parent, file, name, accessibility, data);
this.source_comment = comment;
}
- public Method (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? cname, string? dbus_name, string? dbus_result_name, string? finish_function_cname, MethodBindingType binding_type, bool is_yields, bool is_dbus_visible, bool is_constructor, void* data) {
+ public Method (Node parent, SourceFile file, string name, SymbolAccessibility accessibility,
+ SourceComment? comment, string? cname, string? dbus_name, string? dbus_result_name,
+ string? finish_function_cname, MethodBindingType binding_type, bool is_yields,
+ bool is_dbus_visible, bool is_constructor, void* data)
+ {
base (parent, file, name, accessibility, comment, data);
this.finish_function_cname = finish_function_cname;
*/
public bool is_static {
get {
- return !is_constructor && binding_type == MethodBindingType.STATIC && parent is Namespace == false;
+ return !is_constructor && binding_type == MethodBindingType.STATIC
+ && parent is Namespace == false;
}
}
private string? dbus_name;
private string? cname;
- public Property (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? cname, string? dbus_name, bool is_dbus_visible, PropertyBindingType binding_type, void* data) {
+ public Property (Node parent, SourceFile file, string name, SymbolAccessibility accessibility,
+ SourceComment? comment, string? cname, string? dbus_name, bool is_dbus_visible,
+ PropertyBindingType binding_type, void* data)
+ {
base (parent, file, name, accessibility, comment, data);
this.is_dbus_visible = is_dbus_visible;
private Ownership ownership;
private string? cname;
- public PropertyAccessor (Property parent, SourceFile file, string name, SymbolAccessibility accessibility, string? cname, PropertyAccessorType type, Ownership ownership, void* data) {
+ public PropertyAccessor (Property parent, SourceFile file, string name, SymbolAccessibility accessibility,
+ string? cname, PropertyAccessorType type, Ownership ownership, void* data)
+ {
base (parent, file, name, accessibility, data);
this.ownership = ownership;
}
- public Signal (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? cname, string? dbus_name, bool is_dbus_visible, bool is_virtual, void* data) {
+ public Signal (Node parent, SourceFile file, string name, SymbolAccessibility accessibility,
+ SourceComment? comment, string? cname, string? dbus_name, bool is_dbus_visible,
+ bool is_virtual, void* data)
+ {
base (parent, file, name, accessibility, comment, data);
this.dbus_name = dbus_name;
get;
}
- public SourceComment (string content, SourceFile file, int first_line, int first_column, int last_line, int last_column) {
+ public SourceComment (string content, SourceFile file, int first_line, int first_column,
+ int last_line, int last_column)
+ {
this.first_column = first_column;
this.last_column = last_column;
this.first_line = first_line;
private string? type_id;
private string? cname;
- public Struct (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? cname, string? type_macro_name, string? type_function_name, string? type_id, string? dup_function_cname, string? copy_function_cname, string? destroy_function_cname, string? free_function_cname, bool is_basic_type, void* data) {
- base (parent, file, name, accessibility, comment, type_macro_name, null, null, type_function_name, is_basic_type, data);
+ public Struct (Node parent, SourceFile file, string name, SymbolAccessibility accessibility,
+ SourceComment? comment, string? cname, string? type_macro_name,
+ string? type_function_name, string? type_id, string? dup_function_cname,
+ string? copy_function_cname, string? destroy_function_cname,
+ string? free_function_cname, bool is_basic_type, void* data)
+ {
+ base (parent, file, name, accessibility, comment, type_macro_name, null, null,
+ type_function_name, is_basic_type, data);
this.dup_function_cname = dup_function_cname;
this.copy_function_cname = copy_function_cname;
get;
}
- public Symbol (Node parent, SourceFile file, string? name, SymbolAccessibility accessibility, void* data) {
+ public Symbol (Node parent, SourceFile file, string? name, SymbolAccessibility accessibility,
+ void* data)
+ {
base (parent, file, name, data);
this.accessibility = accessibility;
* @param packages sources
* @param import_directories List of directories where to find the files
*/
- public void import_documentation (DocumentationImporter[] importers, string[] packages, string[] import_directories) {
+ public void import_documentation (DocumentationImporter[] importers, string[] packages,
+ string[] import_directories)
+ {
HashSet<string> processed = new HashSet<string> ();
foreach (string pkg_name in packages) {
bool imported = false;
foreach (DocumentationImporter importer in importers) {
- string? path = get_file_path ("%s.%s".printf (pkg_name, importer.file_extension), import_directories);
+ string? path = get_file_path ("%s.%s".printf (pkg_name, importer.file_extension),
+ import_directories);
if (path == null) {
continue;
}
private string? dbus_type_signature;
private Ownership ownership;
- public TypeReference (Item parent, Ownership ownership, bool pass_ownership, bool is_dynamic, bool is_nullable, string? dbus_type_signature, void* data) {
+ public TypeReference (Item parent, Ownership ownership, bool pass_ownership, bool is_dynamic,
+ bool is_nullable, string? dbus_type_signature, void* data)
+ {
base (data);
this.dbus_type_signature = dbus_type_signature;
private string? type_cast_macro_name;
private string? type_function_name;
- public TypeSymbol (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? type_macro_name, string? is_type_macro_name, string? type_cast_macro_name, string? type_function_name, bool is_basic_type, void* data) {
+ public TypeSymbol (Node parent, SourceFile file, string name, SymbolAccessibility accessibility,
+ SourceComment? comment, string? type_macro_name, string? is_type_macro_name,
+ string? type_cast_macro_name, string? type_function_name, bool is_basic_type,
+ void* data)
+ {
base (parent, file, name, accessibility, data);
this.type_cast_macro_name = type_cast_macro_name;
public override void configure (Settings settings, ResourceLocator locator) {
}
- public override void check (Api.Tree api_root, Api.Node container, string file_path, 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.parent = this;
element.check (api_root, container, file_path, reporter, settings);
public override void configure (Settings settings, ResourceLocator locator) {
}
- public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings 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) {
public virtual void configure (Settings settings, ResourceLocator locator) {
}
- public abstract void check (Api.Tree api_root, Api.Node container, string file_path, 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);
public class Valadoc.Content.Embedded : ContentElement, Inline, StyleAttributes {
- public string url { get; set; }
- public string? caption { get; set; }
+ public string url {
+ get;
+ set;
+ }
+
+ public string? caption {
+ get;
+ set;
+ }
+
+ public HorizontalAlign? horizontal_align {
+ get;
+ set;
+ }
+
+ public VerticalAlign? vertical_align {
+ get;
+ set;
+ }
+
+ public string? style {
+ get;
+ set;
+ }
- public HorizontalAlign? horizontal_align { get; set; }
- public VerticalAlign? vertical_align { get; set; }
- public string? style { get; set; }
public Api.Package package;
private ResourceLocator _locator;
_locator = locator;
}
- public override void check (Api.Tree api_root, Api.Node container, string file_path, 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);
+ 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;
_level = 0;
}
- public override void check (Api.Tree api_root, Api.Node container, string file_path, 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?
public abstract class Valadoc.Content.InlineContent : ContentElement {
- public Gee.List<Inline> content { get { return _content; } }
+ public Gee.List<Inline> content {
+ get {
+ return _content;
+ }
+ }
private Gee.List<Inline> _content;
internal InlineContent () {
}
- public override void check (Api.Tree api_root, Api.Node container, string file_path, 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.parent = this;
element.check (api_root, container, file_path, reporter, settings);
this.locator = locator;
}
- public override void check (Api.Tree api_root, Api.Node container, string file_path, 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.parent = this;
public class Valadoc.Content.Link : InlineContent, Inline {
- public string url { get; set; }
+ public string url {
+ get;
+ set;
+ }
internal Link () {
base ();
public override void configure (Settings settings, ResourceLocator locator) {
}
- public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings 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);
//TODO: check url
}
}
}
- public Bullet bullet { get; set; }
+ public Bullet bullet {
+ get;
+ set;
+ }
+
// TODO add initial value (either a number or some letters)
- public Gee.List<ListItem> items { get { return _items; } }
+ public Gee.List<ListItem> items {
+ get {
+ return _items;
+ }
+ }
private Gee.List<ListItem> _items;
_items = new ArrayList<ListItem> ();
}
- public override void check (Api.Tree api_root, Api.Node container, string file_path, 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.parent = this;
base ();
}
- public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) {
+ public override void check (Api.Tree api_root, Api.Node container, string file_path,
+ ErrorReporter reporter, Settings settings)
+ {
// Check block content
base.check (api_root, container, file_path, reporter, settings);
}
base ();
}
- public override void check (Api.Tree api_root, Api.Node container, string file_path, 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, file_path, reporter, settings);
}
public class Valadoc.Content.Paragraph : InlineContent, Block, StyleAttributes {
- public HorizontalAlign? horizontal_align { get; set; }
- public VerticalAlign? vertical_align { get; set; }
- public string? style { get; set; }
+ public HorizontalAlign? horizontal_align {
+ get;
+ set;
+ }
+
+ public VerticalAlign? vertical_align {
+ get;
+ set;
+ }
+
+ public string? style {
+ get;
+ set;
+ }
internal Paragraph () {
base ();
}
- public override void check (Api.Tree api_root, Api.Node container, string file_path, 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, file_path, reporter, settings);
}
_style = style;
}
- public override void check (Api.Tree api_root, Api.Node container, string file_path, 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, file_path, reporter, settings);
}
}
}
- public string code { get; set; }
- public Language? language { get; set; }
+ public string code {
+ get;
+ set;
+ }
+
+ public Language? language {
+ get;
+ set;
+ }
internal SourceCode () {
base ();
_language = Language.VALA;
}
- private string? get_path (string path, Api.Node container, string source_file_path, ErrorReporter reporter) {
+ private string? get_path (string path, Api.Node container, string source_file_path,
+ ErrorReporter reporter)
+ {
// search relative to our file
if (!Path.is_absolute (path)) {
- string relative_to_file = Path.build_path (Path.DIR_SEPARATOR_S, Path.get_dirname (source_file_path), path);
+ string relative_to_file = Path.build_path (Path.DIR_SEPARATOR_S,
+ Path.get_dirname (source_file_path),
+ path);
if (FileUtils.test (relative_to_file, FileTest.EXISTS | FileTest.IS_REGULAR)) {
return (owned) relative_to_file;
}
return path;
}
- private void load_source_code (string _path, Api.Node container, string source_file_path, ErrorReporter reporter) {
+ private void load_source_code (string _path, Api.Node container, string source_file_path,
+ ErrorReporter reporter)
+ {
string? path = get_path (_path, container, source_file_path, reporter);
if (path == null) {
return ;
code = (owned) content;
} catch (FileError err) {
string node_segment = (container is Api.Package)? "" : container.get_full_name () + ": ";
- reporter.simple_error ("%s: %s{{{: error: Can't read file %s: %s", source_file_path, node_segment, path, err.message);
+ reporter.simple_error ("%s: %s{{{: error: Can't read file %s: %s", source_file_path,
+ node_segment,
+ path,
+ err.message);
}
}
return string.joinv ("\n", (string[]) _lines);
}
- public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) {
+ public override void check (Api.Tree api_root, Api.Node container, string file_path,
+ ErrorReporter reporter, Settings settings)
+ {
string[] splitted = code.split ("\n", 2);
if (splitted[0].strip () == "") {
code = splitted[1] ?? "";
code = splitted[1] ?? "";
if (_language == null && name != "none") {
string node_segment = (container is Api.Package)? "" : container.get_full_name () + ": ";
- reporter.simple_warning ("%s: %s{{{: warning: Unsupported programming language '%s'", file_path, node_segment, name);
+ reporter.simple_warning ("%s: %s{{{: warning: Unsupported programming language '%s'",
+ file_path, node_segment, name);
}
}
}
}
public interface Valadoc.Content.StyleAttributes : ContentElement {
- public abstract HorizontalAlign? horizontal_align { get; set; }
- public abstract VerticalAlign? vertical_align { get; set; }
- public abstract string? style { get; set; }
+ public abstract HorizontalAlign? horizontal_align {
+ get;
+ set;
+ }
+
+ public abstract VerticalAlign? vertical_align {
+ get;
+ set;
+ }
+
+ public abstract string? style {
+ get;
+ set;
+ }
}
public class Valadoc.Content.SymbolLink : ContentElement, Inline {
- public Api.Node symbol { get; set; }
- public string label { get; set; }
+ public Api.Node symbol {
+ get;
+ set;
+ }
+
+ public string label {
+ get;
+ set;
+ }
internal SymbolLink (Api.Node? symbol = null, string? label = null) {
base ();
public override void configure (Settings settings, ResourceLocator locator) {
}
- public override void check (Api.Tree api_root, Api.Node container, string file_path, 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) {
public class Valadoc.Content.Table : ContentElement, Block {
- public Gee.List<TableRow> rows { get { return _rows; } }
+ public Gee.List<TableRow> rows {
+ get {
+ return _rows;
+ }
+ }
private Gee.List<TableRow> _rows;
_rows = new ArrayList<TableRow> ();
}
- public override void check (Api.Tree api_root, Api.Node container, string file_path, 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
public class Valadoc.Content.TableCell : InlineContent, StyleAttributes {
- public HorizontalAlign? horizontal_align { get; set; }
- public VerticalAlign? vertical_align { get; set; }
- public string? style { get; set; }
- public int colspan { get; set; }
- public int rowspan { get; set; }
+ public HorizontalAlign? horizontal_align {
+ get;
+ set;
+ }
+
+ public VerticalAlign? vertical_align {
+ get;
+ set;
+ }
+
+ public string? style {
+ get;
+ set;
+ }
+
+ public int colspan {
+ get;
+ set;
+ }
+
+ public int rowspan {
+ get;
+ set;
+ }
internal TableCell () {
base ();
_rowspan = 1;
}
- public override void check (Api.Tree api_root, Api.Node container, string file_path, 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, file_path, reporter, settings);
}
public class Valadoc.Content.TableRow : ContentElement {
- public Gee.List<TableCell> cells { get { return _cells; } }
+ public Gee.List<TableCell> cells {
+ get {
+ return _cells;
+ }
+ }
private Gee.List<TableCell> _cells;
_cells = new ArrayList<TableCell> ();
}
- public override void check (Api.Tree api_root, Api.Node container, string file_path, 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.parent = this;
public class Valadoc.Content.Text : ContentElement, Inline {
- public string content { get; set; }
+ public string content {
+ get;
+ set;
+ }
construct {
_content = "";
}
}
- public override void check (Api.Tree api_root, Api.Node container, string file_path, 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) {
base ();
}
- public override void check (Api.Tree api_root, Api.Node container, string file_path, 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, file_path, reporter, settings);
}
public class Valadoc.Content.WikiLink : InlineContent, Inline {
- public WikiPage page { get; internal set; }
- public string name { get; set; }
+ public WikiPage page {
+ internal set;
+ get;
+ }
+
+ public string name {
+ get;
+ set;
+ }
internal WikiLink () {
base ();
}
- public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings 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);
page = api_root.wikitree.search (name);
}
public MarkupWriter start_book (string title, string lang, string link, string name, string version, string author) {
- this.start_tag ("book", {"xmlns", "http://www.devhelp.net/book", "title", title, "language", lang, "name", name, "version", version, "author", author, "link", link});
+ this.start_tag ("book", {"xmlns", "http://www.devhelp.net/book",
+ "title", title,
+ "language", lang,
+ "name", name,
+ "version", version,
+ "author", author,
+ "link", link});
return this;
}
public class Valadoc.DocumentationParser : Object, ResourceLocator {
- public DocumentationParser (Settings settings, ErrorReporter reporter, Api.Tree tree, ModuleLoader modules) {
+ public DocumentationParser (Settings settings, ErrorReporter reporter,
+ Api.Tree tree, ModuleLoader modules)
+ {
_settings = settings;
_reporter = reporter;
_tree = tree;
Comment doc_comment = gtkdoc_parser.parse (element, (Api.GirSourceComment) comment);
return doc_comment;
} else {
- return parse_comment_str (element, comment.content, comment.file.get_name (), comment.first_line, comment.first_column);
+ return parse_comment_str (element, comment.content, comment.file.get_name (),
+ comment.first_line, comment.first_column);
}
}
- public Comment? parse_comment_str (Api.Node element, string content, string filename, int first_line, int first_column) {
+ 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, filename, _reporter, _settings);
}
}
- private Comment parse_comment (string content, string filename, int first_line, int first_column) throws ParserError {
+ private Comment parse_comment (string content, string filename, int first_line, int first_column)
+ throws ParserError
+ {
_parser = _comment_parser;
_scanner = _comment_scanner;
_stack.clear ();
((Paragraph) ((ListItem) peek ()).content[0]).content.add (_factory.create_text (" "));
return;
} else if (list.bullet != bullet) {
- _parser.error (null, "Invalid bullet type '%s': expected '%s'".printf (bullet_type_string (bullet), bullet_type_string (list.bullet)));
+ _parser.error (null, "Invalid bullet type '%s': expected '%s'"
+ .printf (bullet_type_string (bullet), bullet_type_string (list.bullet)));
return;
}
if (head is Text) {
text_node = (Text) head;
- } else if (head is InlineContent && ((InlineContent) head).content.size > 0 && ((InlineContent) head).content.last () is Text) {
+ } else if (head is InlineContent && ((InlineContent) head).content.size > 0
+ && ((InlineContent) head).content.last () is Text)
+ {
text_node = (Text) ((InlineContent) head).content.last ();
} else {
text_node = _factory.create_text ();
private bool show_warnings;
private Api.SourceComment comment;
+ private unowned string instance_param_name;
private string[]? comment_lines;
this.comment_lines = this.comment.content.split ("\n");
}
- this.reporter.warning (this.comment.file.get_name (), comment.first_line + got.line, startpos + 1, endpos + 1, this.comment_lines[got.line], "Unexpected Token: %s (Expected: %s)", got.to_string (), expected);
+ this.reporter.warning (this.comment.file.get_name (),
+ comment.first_line + got.line,
+ startpos + 1,
+ endpos + 1,
+ this.comment_lines[got.line],
+ "Unexpected Token: %s (Expected: %s)",
+ got.to_string (),
+ expected);
}
public Parser (Settings settings, ErrorReporter reporter, Api.Tree tree, ModuleLoader modules) {
this.tree = tree;
try {
- is_numeric_regex = new Regex ("^[+-]?([0-9]*\\.?[0-9]+|[0-9]+\\.?[0-9]*)([eE][+-]?[0-9]+)?$", RegexCompileFlags.OPTIMIZE);
+ is_numeric_regex = new Regex ("^[+-]?([0-9]*\\.?[0-9]+|[0-9]+\\.?[0-9]*)([eE][+-]?[0-9]+)?$",
+ RegexCompileFlags.OPTIMIZE);
normalize_regex = new Regex ("( |\n|\t)+", RegexCompileFlags.OPTIMIZE);
} catch (RegexError e) {
assert_not_reached ();
public Comment? parse (Api.Node element, Api.GirSourceComment gir_comment) {
this.current_metadata = get_metadata_for_comment (gir_comment);
+ this.instance_param_name = gir_comment.instance_param_name;
this.element = element;
Comment? comment = this.parse_main_content (gir_comment);
}
private bool check_xml_open_tag (string tagname) {
- if ((current.type == TokenType.XML_OPEN && current.content != tagname) || current.type != TokenType.XML_OPEN) {
+ if ((current.type == TokenType.XML_OPEN && current.content != tagname)
+ || current.type != TokenType.XML_OPEN)
+ {
return false;
}
}
private bool check_xml_close_tag (string tagname) {
- if ((current.type == TokenType.XML_CLOSE && current.content != tagname) || current.type != TokenType.XML_CLOSE) {
+ if ((current.type == TokenType.XML_CLOSE && current.content != tagname)
+ || current.type != TokenType.XML_CLOSE)
+ {
return false;
}
next ();
// TODO: check xml
- while (!(current.type == TokenType.XML_CLOSE && current.content == tagname) && current.type != TokenType.EOF) {
+ while (!(current.type == TokenType.XML_CLOSE && current.content == tagname)
+ && current.type != TokenType.EOF)
+ {
if (current.type == TokenType.XML_OPEN) {
} else if (current.type == TokenType.XML_CLOSE) {
} else if (current.type == TokenType.XML_COMMENT) {
}
- if (current.type == TokenType.GTKDOC_FUNCTION || current.type == TokenType.GTKDOC_CONST || current.type == TokenType.GTKDOC_TYPE || current.type == TokenType.WORD || current.type == TokenType.GTKDOC_PROPERTY || current.type == TokenType.GTKDOC_SIGNAL) {
+ if (current.type == TokenType.GTKDOC_FUNCTION || current.type == TokenType.GTKDOC_CONST
+ || current.type == TokenType.GTKDOC_TYPE || current.type == TokenType.WORD
+ || current.type == TokenType.GTKDOC_PROPERTY || current.type == TokenType.GTKDOC_SIGNAL)
+ {
taglet = this.create_type_link (current.content) as InlineTaglet;
assert (taglet != null);
}
return parse_docbook_itemizedlist ("orderedlist", Content.List.Bullet.ORDERED);
}
- private LinkedList<Block>? parse_docbook_itemizedlist (string tag_name = "itemizedlist", Content.List.Bullet bullet_type = Content.List.Bullet.UNORDERED) {
+ private LinkedList<Block>? parse_docbook_itemizedlist (string tag_name = "itemizedlist",
+ Content.List.Bullet bullet_type = Content.List.Bullet.UNORDERED)
+ {
if (!check_xml_open_tag (tag_name)) {
this.report_unexpected_token (current, "<%s>".printf (tag_name));
return null;
StringBuilder builder = new StringBuilder ();
- for (next (); current.type != TokenType.EOF && !(current.type == TokenType.XML_CLOSE && current.content == "programlisting"); next ()) {
+ for (next (); current.type != TokenType.EOF && !(current.type == TokenType.XML_CLOSE
+ && current.content == "programlisting"); next ())
+ {
if (current.type == TokenType.WORD) {
builder.append (current.content);
} else if (current.type != TokenType.XML_COMMENT) {
return {id};
}
- private string? resolve_parameter_ctype (string parameter_name, out string? param_name, out string? param_array_name, out bool is_return_type_len) {
+ private string? resolve_parameter_ctype (string parameter_name, out string? param_name,
+ out string? param_array_name, out bool is_return_type_len)
+ {
string[]? parts = split_type_name (parameter_name);
is_return_type_len = false;
param_array_name = null;
}
}
- if (this.element is Api.Callable && ((Api.Callable) this.element).implicit_array_length_cparameter_name == parts[0]) {
+ if (this.element is Api.Callable
+ && ((Api.Callable) this.element).implicit_array_length_cparameter_name == parts[0])
+ {
is_return_type_len = true;
}
public int first_column;
public int last_column;
- public Token (TokenType type, string content, HashMap<string, string>? attributes, string start, int length, int line, int first_column, int last_column) {
+ public Token (TokenType type, string content, HashMap<string, string>? attributes, string start,
+ int length, int line, int first_column, int last_column)
+ {
this.attributes = attributes;
this.content = content;
this.length = length;
}
private inline bool letter (unichar c) {
- return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
+ return (c >= 'a' && c <= 'z')
+ || (c >= 'A' && c <= 'Z');
}
private inline bool letter_or_number (unichar c) {
- return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9');
+ return (c >= 'a' && c <= 'z')
+ || (c >= 'A' && c <= 'Z')
+ || (c >= '0' && c <= '9');
}
private inline bool space (unichar c) {
}
next_char ();
- return new Token (TokenType.GTKDOC_FUNCTION, start.substring (0, id_len), null, start, offset (this.pos, start), this.line, column_start, this.column);
+ return new Token (TokenType.GTKDOC_FUNCTION,
+ start.substring (0, id_len),
+ null,
+ start,
+ offset (this.pos, start),
+ this.line,
+ column_start,
+ this.column);
}
private inline Token? gtkdoc_symbolic_link_prefix (unichar c, TokenType type) {
}
}
- return new Token (type, start.substring (1, id_len), null, start, offset (this.pos, start), this.line, column_start, this.column);
+ return new Token (type,
+ start.substring (1, id_len),
+ null,
+ start,
+ offset (this.pos, start),
+ this.line,
+ column_start,
+ this.column);
}
private inline Token? gtkdoc_property_prefix () {
return null;
}
- return new Token (TokenType.GTKDOC_PROPERTY, start.substring (1, id_len), null, start, offset (this.pos, start), this.line, column_start, this.column);
+ return new Token (TokenType.GTKDOC_PROPERTY,
+ start.substring (1, id_len),
+ null,
+ start,
+ offset (this.pos, start),
+ this.line,
+ column_start,
+ this.column);
}
private inline Token? gtkdoc_signal_prefix () {
return null;
}
- return new Token (TokenType.GTKDOC_SIGNAL, start.substring (1, id_len), null, start, offset (this.pos, start), this.line, column_start, this.column);
+ return new Token (TokenType.GTKDOC_SIGNAL,
+ start.substring (1, id_len),
+ null,
+ start,
+ offset (this.pos, start),
+ this.line,
+ column_start,
+ this.column);
}
private inline Token? gtkdoc_const_prefix () {
next_char ();
next_char ();
next_char ();
- return new Token (TokenType.XML_COMMENT, "", null, start, offset (this.pos, start), this.line, column_start, this.column);
+ return new Token (TokenType.XML_COMMENT,
+ "",
+ null,
+ start,
+ offset (this.pos, start),
+ this.line,
+ column_start,
+ this.column);
}
}
} else if (this.pos.has_prefix ("[CDATA[")) {
next_char ();
next_char ();
next_char ();
- return new Token (TokenType.WORD, unescape (content), null, start, offset (this.pos, start), this.line, column_start, this.column);
+ return new Token (TokenType.WORD,
+ unescape (content),
+ null,
+ start,
+ offset (this.pos, start),
+ this.line,
+ column_start,
+ this.column);
}
}
}
next_char ();
if (open_and_close) {
- this.tmp_token = new Token (TokenType.XML_CLOSE, id_start.substring (0, id_len), null, start, offset (this.pos, start), this.line, column_start, this.column);
+ this.tmp_token = new Token (TokenType.XML_CLOSE,
+ id_start.substring (0, id_len),
+ null,
+ start,
+ offset (this.pos, start),
+ this.line,
+ column_start,
+ this.column);
}
if (close) {
- return new Token (TokenType.XML_CLOSE, id_start.substring (0, id_len), null, start, offset (this.pos, start), this.line, column_start, this.column);
+ return new Token (TokenType.XML_CLOSE,
+ id_start.substring (0, id_len),
+ null,
+ start,
+ offset (this.pos, start),
+ this.line,
+ column_start,
+ this.column);
} else {
- return new Token (TokenType.XML_OPEN, id_start.substring (0, id_len), map, start, offset (this.pos, start), this.line, column_start, this.column);
+ return new Token (TokenType.XML_OPEN,
+ id_start.substring (0, id_len),
+ map,
+ start,
+ offset (this.pos, start),
+ this.line,
+ column_start,
+ this.column);
}
}
next_char ();
this.line++;
this.column = 0;
- return new Token (TokenType.GTKDOC_PARAGRAPH, "\n\n", null, start, offset (this.pos, start), this.line, this.column, this.column);
+ return new Token (TokenType.GTKDOC_PARAGRAPH,
+ "\n\n",
+ null,
+ start,
+ offset (this.pos, start),
+ this.line,
+ this.column,
+ this.column);
} else {
- return new Token (TokenType.NEWLINE, "\n", null, start, offset (this.pos, start), this.line, this.column, this.column);
+ return new Token (TokenType.NEWLINE,
+ "\n",
+ null,
+ start,
+ offset (this.pos, start),
+ this.line,
+ this.column,
+ this.column);
}
}
return null;
}
- return new Token (TokenType.EOF, "", null, this.pos, 1, this.line, this.column, this.column);
+ return new Token (TokenType.EOF,
+ "",
+ null,
+ this.pos,
+ 1,
+ this.line,
+ this.column,
+ this.column);
}
private Token? space_prefix () {
return null;
}
- return new Token (TokenType.SPACE, start.substring (0, len), null, start, offset (this.pos, start), this.line, column_start, this.column);
+ return new Token (TokenType.SPACE,
+ start.substring (0, len),
+ null,
+ start,
+ offset (this.pos, start),
+ this.line,
+ column_start,
+ this.column);
}
private Token? word_prefix () {
return null;
}
- return new Token (TokenType.WORD, unescape (start.substring (0, len)), null, start, offset (this.pos, start), this.line, column_start, this.column);
+ return new Token (TokenType.WORD,
+ unescape (start.substring (0, len)),
+ null,
+ start,
+ offset (this.pos, start),
+ this.line,
+ column_start,
+ this.column);
}
private Token? gtkdoc_source_open_prefix () {
next_char ();
next_char ();
- return new Token (TokenType.GTKDOC_SOURCE_OPEN, "|[", null, start, offset (this.pos, start), this.line, column_start, this.column);
+ return new Token (TokenType.GTKDOC_SOURCE_OPEN,
+ "|[",
+ null,
+ start,
+ offset (this.pos, start),
+ this.line,
+ column_start,
+ this.column);
}
private Token? gtkdoc_source_close_prefix () {
next_char ();
next_char ();
- return new Token (TokenType.GTKDOC_SOURCE_CLOSE, "]|", null, start, offset (this.pos, start), this.line, column_start, this.column);
+ return new Token (TokenType.GTKDOC_SOURCE_CLOSE, "]|",
+ null,
+ start,
+ offset (this.pos, start),
+ this.line,
+ column_start,
+ this.column);
}
public Token next () {
}
}
-
return null;
}
- private void create_tree_from_path (DocumentationParser docparser, Api.Package package, ErrorReporter reporer, string path, string? nameoffset = null) {
+ private void create_tree_from_path (DocumentationParser docparser, Api.Package package,
+ ErrorReporter reporer, string path, string? nameoffset = null)
+ {
try {
Dir dir = Dir.open (path);
for (string? curname = dir.read_name (); curname!=null ; curname = dir.read_name ()) {
string filename = Path.build_filename (path, curname);
if (curname.has_suffix (".valadoc") && FileUtils.test (filename, FileTest.IS_REGULAR)) {
- WikiPage wikipage = new WikiPage ((nameoffset!=null)? Path.build_filename (nameoffset, curname) : curname, filename, package);
+ WikiPage wikipage = new WikiPage ((nameoffset!=null)
+ ? Path.build_filename (nameoffset, curname)
+ : curname, filename, package);
this.wikipages.add(wikipage);
wikipage.read (reporter);
} else if (FileUtils.test (filename, FileTest.IS_DIR)) {
- this.create_tree_from_path (docparser, package, reporter, filename, (nameoffset!=null)? Path.build_filename (nameoffset, curname) : curname);
+ this.create_tree_from_path (docparser, package, reporter, filename, (nameoffset!=null)
+ ? Path.build_filename (nameoffset, curname)
+ : curname);
}
}
} catch (FileError err) {
}
}
- private void look_for_three (unichar c, TokenType one, TokenType two, TokenType three) throws ParserError {
+ private void look_for_three (unichar c, TokenType one, TokenType two, TokenType three)
+ throws ParserError
+ {
if (get_next_char (1) == c) {
if (get_next_char (2) == c) {
emit_token (three);
}
}
- private void look_for_five (unichar c, TokenType one, TokenType two, TokenType three, TokenType four, TokenType five) throws ParserError {
+ private void look_for_five (unichar c, TokenType one, TokenType two, TokenType three,
+ TokenType four, TokenType five) throws ParserError
+ {
if (get_next_char (1) == c) {
if (get_next_char (2) == c) {
if (get_next_char (3) == c) {
this.settings = settings;
}
- private inline void msg (string type, string file, long line, long startpos, long endpos, string errline, string msg_format, va_list args) {
- this.stream.printf ("%s:%lu.%lu-%lu.%lu: %s: ", file, line, startpos, line, endpos, type);
+ private inline void msg (string type, string file, long line, long startpos, long endpos,
+ string errline, string msg_format, va_list args)
+ {
+ this.stream.printf ("%s:%lu.%lu-%lu.%lu: %s: ", file, line, startpos,
+ line, endpos, type);
this.stream.vprintf (msg_format, args);
this.stream.putc ('\n');
}
}
- public void error (string file, long line, long startpos, long endpos, string errline, string msg_format, ...) {
+ public void error (string file, long line, long startpos, long endpos, string errline,
+ string msg_format, ...)
+ {
var args = va_list();
this.msg ("error", file, line, startpos, endpos, errline, msg_format, args);
this._errors++;
}
- public void warning (string file, long line, long startpos, long endpos, string errline, string msg_format, ...) {
+ public void warning (string file, long line, long startpos, long endpos, string errline,
+ string msg_format, ...)
+ {
var args = va_list();
this.msg ("warning", file, line, startpos, endpos, errline, msg_format, args);
this._warnings++;
writer.set_wrap (false);
if (item is Api.Method) {
- writer.start_tag ("function").text (((Api.Method)item).get_cname ()).end_tag ("function");
+ writer.start_tag ("function")
+ .text (((Api.Method)item).get_cname ())
+ .end_tag ("function");
} else if (item is Api.FormalParameter) {
- writer.start_tag ("parameter").text (((Api.FormalParameter)item).name ?? "...").end_tag ("parameter");
+ writer.start_tag ("parameter").
+ text (((Api.FormalParameter)item).name ?? "...")
+ .end_tag ("parameter");
} else if (item is Api.Constant) {
- writer.start_tag ("constant").text (((Api.Constant)item).get_cname ()).end_tag ("constant");
+ writer.start_tag ("constant").text (((Api.Constant)item)
+ .get_cname ())
+ .end_tag ("constant");
} else if (item is Api.Property) {
// TODO: use docbook-tags instead
- writer.text ("#").text (get_cname(item.parent)).text (":").text (((Api.Property)item).get_cname ().replace ("_", "-"));
+ writer.text ("#").text (get_cname(item.parent))
+ .text (":")
+ .text (((Api.Property)item)
+ .get_cname ().replace ("_", "-"));
} else if (item is Api.Signal) {
// TODO: use docbook-tags instead
- writer.text ("#").text (get_cname(item.parent)).text ("::").text (((Api.Signal)item).get_cname ().replace ("_", "-"));
+ writer.text ("#").text (get_cname(item.parent))
+ .text ("::")
+ .text (((Api.Signal)item).get_cname ().replace ("_", "-"));
} else if (item is Api.Namespace) {
writer.text (((Api.Namespace) item).get_full_name ());
} else {
- writer.start_tag ("type").text (get_cname (item)).end_tag ("type");
+ writer.start_tag ("type")
+ .text (get_cname (item))
+ .end_tag ("type");
}
writer.set_wrap (true);
public override void visit_embedded (Embedded element) {
writer.start_tag ("figure");
if (element.caption != null) {
- writer.start_tag ("title").text (element.caption).end_tag ("title");
+ writer.start_tag ("title")
+ .text (element.caption)
+ .end_tag ("title");
}
writer.start_tag ("mediaobject");
- writer.start_tag ("imageobject").simple_tag ("imagedata", {"fileref", element.url}).end_tag ("imageobject");
+ writer.start_tag ("imageobject")
+ .simple_tag ("imagedata", {"fileref", element.url})
+ .end_tag ("imageobject");
if (element.caption != null) {
- writer.start_tag ("textobject").start_tag ("phrase").text (element.caption).end_tag ("phrase").end_tag ("textobject");
+ writer.start_tag ("textobject")
+ .start_tag ("phrase")
+ .text (element.caption)
+ .end_tag ("phrase")
+ .end_tag ("textobject");
}
writer.end_tag ("mediaobject");
}
public override void visit_source_code (SourceCode element) {
- writer.start_tag ("example").start_tag ("programlisting");
+ writer.start_tag ("example")
+ .start_tag ("programlisting");
writer.text (element.code);
- writer.end_tag ("programlisting").end_tag ("example");
+ writer.end_tag ("programlisting")
+ .end_tag ("example");
}
public override void visit_table (Table element) {
}
writer.set_wrap (false);
- writer.text ("\nSince: ").text (taglet.version);
+ writer.text ("\nSince: ")
+ .text (taglet.version);
writer.set_wrap (true);
separated = true;
}
if (first) {
- writer.start_tag ("para").text ("This function may throw:").end_tag ("para");
+ writer.start_tag ("para")
+ .text ("This function may throw:")
+ .end_tag ("para");
writer.start_tag ("table");
}
public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
- public Html.LinkHelper linker { protected set; get; }
- public Settings settings { protected set; get; }
+ public Html.LinkHelper linker {
+ protected set;
+ get;
+ }
+
+ public Settings settings {
+ protected set;
+ get;
+ }
+
protected Api.Tree tree;
protected HtmlRenderer _renderer;
protected Html.MarkupWriter writer;
}
protected virtual string get_img_path (Api.Node element, string type) {
- return Path.build_filename (settings.path, element.package.name, "img", element.get_full_name () + "." + type);
+ return Path.build_filename (settings.path, element.package.name, "img",
+ element.get_full_name () + "." + type);
}
protected virtual string get_icon_directory () {
writer.end_tag ("li");
}
- protected void write_navi_entry_html_template_with_link (string style, string link, string content, bool is_deprecated) {
+ protected void write_navi_entry_html_template_with_link (string style, string link,
+ string content, bool is_deprecated)
+ {
writer.start_tag ("li", {"class", style});
if (is_deprecated) {
writer.end_tag ("li");
}
- protected void write_navi_entry (Api.Node element, Api.Node? pos, string style, bool link, bool full_name = false) {
+ protected void write_navi_entry (Api.Node element, Api.Node? pos, string style,
+ bool link, bool full_name = false)
+ {
string name;
if (full_name == true && element is Namespace) {
bool is_deprecated = element is Symbol && ((Symbol) element).is_deprecated;
if (link == true) {
- this.write_navi_entry_html_template_with_link (style, this.get_link (element, pos), name, is_deprecated);
+ this.write_navi_entry_html_template_with_link (style,
+ this.get_link (element, pos),
+ name,
+ is_deprecated);
} else {
this.write_navi_entry_html_template (style, name, is_deprecated);
}
}
- protected void write_wiki_pages (Api.Tree tree, string css_path_wiki, string js_path_wiki, string contentp) {
+ protected void write_wiki_pages (Api.Tree tree, string css_path_wiki, string js_path_wiki,
+ string contentp)
+ {
if (tree.wikitree == null) {
return ;
}
}
}
- protected virtual void write_wiki_page (WikiPage page, string contentp, string css_path, string js_path, string pkg_name) {
- GLib.FileStream file = GLib.FileStream.open (Path.build_filename(contentp, page.name.substring (0, page.name.length-7).replace ("/", ".")+"htm"), "w");
+ protected virtual void write_wiki_page (WikiPage page, string contentp, string css_path,
+ string js_path, string pkg_name)
+ {
+ GLib.FileStream file = GLib.FileStream.open (
+ Path.build_filename (contentp, page.name.substring (0, page.name.length-7).replace ("/", ".")+"htm"),
+ "w");
+
writer = new MarkupWriter (file);
_renderer.set_writer (writer);
this.write_file_header (css_path, js_path, pkg_name);
}
writer.start_tag ("div", {"class", css_package_note});
- writer.start_tag ("b").text ("Package:").end_tag ("b");
- writer.text (" ").start_tag ("a", {"href", get_link (element.package, element)}).text (package).end_tag ("a");
+ writer.start_tag ("b")
+ .text ("Package:")
+ .end_tag ("b");
+ writer.text (" ")
+ .start_tag ("a", {"href", get_link (element.package, element)})
+ .text (package)
+ .end_tag ("a");
writer.end_tag ("div");
}
}
writer.start_tag ("div", {"class", css_namespace_note});
- writer.start_tag ("b").text ("Namespace:").end_tag ("b");
- writer.text (" ").start_tag ("a", {"href", get_link (ns, element)}).text (ns.get_full_name()).end_tag ("a");
+ writer.start_tag ("b")
+ .text ("Namespace:")
+ .end_tag ("b");
+ writer.text (" ")
+ .start_tag ("a", {"href", get_link (ns, element)})
+ .text (ns.get_full_name())
+ .end_tag ("a");
writer.end_tag ("div");
}
if (replacement != null) {
string replacement_name = replacement.get_value_as_string ();
- Api.Node? replacement_node = tree.search_symbol_str (pos, replacement_name.substring (1, replacement_name.length - 2));
+ Api.Node? replacement_node = tree.search_symbol_str (pos,
+ replacement_name.substring (1, replacement_name.length - 2));
writer.text (" Use ");
if (replacement_node == null) {
string css = cssresolver.resolve (replacement_node);
writer.link (link, replacement_node.get_full_name (), css);
} else {
- writer.start_tag ("code").text (replacement_node.get_full_name ()).end_tag ("code");
+ writer.start_tag ("code")
+ .text (replacement_node.get_full_name ())
+ .end_tag ("code");
}
}
writer.text (".");
public void write_package_index_content (Api.Tree tree) {
writer.start_tag ("div", {"class", css_style_content});
- writer.start_tag ("h1", {"class", css_title}).text ("Packages:").end_tag ("h1");
+ writer.start_tag ("h1", {"class", css_title})
+ .text ("Packages:")
+ .end_tag ("h1");
writer.simple_tag ("hr", {"class", css_headline_hr});
- WikiPage? wikiindex = (tree.wikitree == null)? null : tree.wikitree.search ("index.valadoc");
+ WikiPage? wikiindex = (tree.wikitree == null)
+ ? null
+ : tree.wikitree.search ("index.valadoc");
if (wikiindex != null) {
_renderer.set_container (wikiindex);
_renderer.render (wikiindex.documentation);
}
- writer.start_tag ("h2", {"class", css_title}).text ("Content:").end_tag ("h2");
- writer.start_tag ("h3", {"class", css_title}).text ("Packages:").end_tag ("h3");
+ writer.start_tag ("h2", {"class", css_title})
+ .text ("Content:")
+ .end_tag ("h2");
+ writer.start_tag ("h3", {"class", css_title})
+ .text ("Packages:")
+ .end_tag ("h3");
this.write_navi_packages_inline (tree);
writer.end_tag ("div");
}
// headline:
writer.start_tag ("div", {"class", css_box_headline});
- writer.start_tag ("div", {"class", css_box_headline_text}).text (headline).end_tag ("div");
+ writer.start_tag ("div", {"class", css_box_headline_text})
+ .text (headline)
+ .end_tag ("div");
writer.start_tag ("div", {"class", css_box_headline_toggle});
- writer.start_tag ("img", {"onclick", "toggle_box (this, '" + html_id + "')", "src", Path.build_filename (get_icon_directory (), "coll_open.png")});
+ writer.start_tag ("img", {"onclick",
+ "toggle_box (this, '" + html_id + "')",
+ "src",
+ Path.build_filename (get_icon_directory (),
+ "coll_open.png")});
writer.raw_text (" ");
writer.end_tag ("div");
writer.end_tag ("div");
public void write_symbol_content (Api.Node node) {
writer.start_tag ("div", {"class", css_style_content});
- writer.start_tag ("h1", {"class", css_title}).text (node.name).end_tag ("h1");
+ writer.start_tag ("h1", {"class", css_title})
+ .text (node.name)
+ .end_tag ("h1");
writer.simple_tag ("hr", {"class", css_headline_hr});
this.write_image_block (node);
- writer.start_tag ("h2", {"class", css_title}).text ("Description:").end_tag ("h2");
+ writer.start_tag ("h2", {"class", css_title})
+ .text ("Description:")
+ .end_tag ("h2");
writer.start_tag ("div", {"class", css_code_definition});
if (node is Symbol) {
this.write_attributes ((Symbol) node, node);
if (node is Class) {
var cl = node as Class;
- write_known_symbols_note (cl.get_known_child_classes (), cl, "All known sub-classes:");
- write_known_symbols_note (cl.get_known_derived_interfaces (), cl, "Required by:");
+ write_known_symbols_note (cl.get_known_child_classes (),
+ cl,
+ "All known sub-classes:");
+ write_known_symbols_note (cl.get_known_derived_interfaces (),
+ cl,
+ "Required by:");
} else if (node is Interface) {
var iface = node as Interface;
- write_known_symbols_note (iface.get_known_implementations (), iface, "All known implementing classes:");
- write_known_symbols_note (iface.get_known_related_interfaces (), iface, "All known sub-interfaces:");
+ write_known_symbols_note (iface.get_known_implementations (),
+ iface,
+ "All known implementing classes:");
+ write_known_symbols_note (iface.get_known_related_interfaces (),
+ iface,
+ "All known sub-interfaces:");
} else if (node is Struct) {
var stru = node as Struct;
- write_known_symbols_note (stru.get_known_child_structs (), stru, "All known sub-structs:");
+ write_known_symbols_note (stru.get_known_child_structs (),
+ stru,
+ "All known sub-structs:");
}
}
private void write_inherited_members_headline () {
- writer.start_tag ("h3", {"class", css_title}).text ("Inherited Members:").end_tag ("h3");
+ writer.start_tag ("h3", {"class", css_title})
+ .text ("Inherited Members:")
+ .end_tag ("h3");
}
private void write_inherited_symbols_note_for_class (Class cl, Api.Node container) {
}
private void write_inherited_symbols_note (TypeSymbol symbol, string type, Api.Node container) {
- write_known_symbols_note (symbol.get_children_by_types (inheritable_members, false), container, "All known members inherited from %s %s".printf (type, symbol.get_full_name ()));
+ write_known_symbols_note (symbol.get_children_by_types (inheritable_members, false),
+ container,
+ "All known members inherited from %s %s".printf (type, symbol.get_full_name ()));
/*
- write_known_symbols_note (symbol.get_children_by_type (NodeType.CONSTANT, false), container, "All known constants inherited from %s %s".printf (type, symbol.get_full_name ()));
- write_known_symbols_note (symbol.get_children_by_type (NodeType.PROPERTY, false), container, "All known properties inherited from %s %s".printf (type, symbol.get_full_name ()));
- write_known_symbols_note (symbol.get_children_by_type (NodeType.DELEGATE, false), container, "All known delegates inherited from %s %s".printf (type, symbol.get_full_name ()));
- write_known_symbols_note (symbol.get_children_by_type (NodeType.STATIC_METHOD, false), container, "All known static methods inherited from %s %s".printf (type, symbol.get_full_name ()));
- write_known_symbols_note (symbol.get_children_by_type (NodeType.METHOD, false), container, "All known methods inherited from %s %s".printf (type, symbol.get_full_name ()));
- write_known_symbols_note (symbol.get_children_by_type (NodeType.SIGNAL, false), container, "All known signals inherited from %s %s".printf (type, symbol.get_full_name ()));
- write_known_symbols_note (symbol.get_children_by_type (NodeType.FIELD, false), container, "All known fields inherited from %s %s".printf (type, symbol.get_full_name ()));
+ write_known_symbols_note (symbol.get_children_by_type (NodeType.CONSTANT, false),
+ container,
+ "All known constants inherited from %s %s".printf (type, symbol.get_full_name ()));
+ write_known_symbols_note (symbol.get_children_by_type (NodeType.PROPERTY, false),
+ container,
+ "All known properties inherited from %s %s".printf (type, symbol.get_full_name ()));
+ write_known_symbols_note (symbol.get_children_by_type (NodeType.DELEGATE, false),
+ container,
+ "All known delegates inherited from %s %s".printf (type, symbol.get_full_name ()));
+ write_known_symbols_note (symbol.get_children_by_type (NodeType.STATIC_METHOD, false),
+ container,
+ "All known static methods inherited from %s %s".printf (type, symbol.get_full_name ()));
+ write_known_symbols_note (symbol.get_children_by_type (NodeType.METHOD, false),
+ container,
+ "All known methods inherited from %s %s".printf (type, symbol.get_full_name ()));
+ write_known_symbols_note (symbol.get_children_by_type (NodeType.SIGNAL, false),
+ container,
+ "All known signals inherited from %s %s".printf (type, symbol.get_full_name ()));
+ write_known_symbols_note (symbol.get_children_by_type (NodeType.FIELD, false),
+ container,
+ "All known fields inherited from %s %s".printf (type, symbol.get_full_name ()));
*/
}
bool with_childs = parent != null && parent is Package;
- writer.start_tag ("h3", {"class", css_title}).text ("Namespaces:").end_tag ("h3");
+ writer.start_tag ("h3", {"class", css_title})
+ .text ("Namespaces:")
+ .end_tag ("h3");
writer.start_tag ("ul", {"class", css_inline_navigation});
foreach (Namespace child in namespaces) {
if (child.name != null) {
return;
}
- writer.start_tag ("h2", {"class", css_title}).text ("Dependencies:").end_tag ("h2");
+ writer.start_tag ("h2", {"class", css_title})
+ .text ("Dependencies:")
+ .end_tag ("h2");
writer.start_tag ("ul", {"class", css_inline_navigation});
foreach (Package p in deps) {
string? link = this.get_link (p, parent);
if (link == null) {
- writer.start_tag ("li", {"class", cssresolver.resolve (p), "id", p.name}).text (p.name).end_tag ("li");
+ writer.start_tag ("li", {"class", cssresolver.resolve (p), "id", p.name})
+ .text (p.name)
+ .end_tag ("li");
} else {
writer.start_tag ("li", {"class", cssresolver.resolve (p)});
writer.link (get_link (p, parent), p.name);
protected void write_children (Api.Node node, Api.NodeType type, string type_string, Api.Node? container) {
var children = node.get_children_by_type (type);
if (children.size > 0) {
- writer.start_tag ("h3", {"class", css_title}).text (type_string).text (":").end_tag ("h3");
+ writer.start_tag ("h3", {"class", css_title})
+ .text (type_string)
+ .text (":")
+ .end_tag ("h3");
writer.start_tag ("ul", {"class", css_inline_navigation});
foreach (Api.Node child in children) {
writer.start_tag ("li", {"class", cssresolver.resolve (child)});
var chart = new Charts.Hierarchy (image_factory, element);
chart.save (this.get_img_path (element, "png"), "png");
- writer.start_tag ("h2", {"class", css_title}).text ("Object Hierarchy:").end_tag ("h2");
-
- writer.simple_tag ("img", {"class", css_diagram, "usemap", "#"+element.get_full_name (),"alt", "Object hierarchy for %s".printf (element.name), "src", this.get_img_path_html (element, "png")});
+ writer.start_tag ("h2", {"class", css_title})
+ .text ("Object Hierarchy:")
+ .end_tag ("h2");
+
+ writer.simple_tag ("img", {"class",
+ css_diagram,
+ "usemap",
+ "#"+element.get_full_name (),
+ "alt",
+ "Object hierarchy for %s".printf (element.name),
+ "src",
+ this.get_img_path_html (element, "png")});
writer.add_usemap (chart);
}
}
public void write_namespace_content (Namespace node, Api.Node? parent) {
writer.start_tag ("div", {"class", css_style_content});
- writer.start_tag ("h1", {"class", css_title}).text (node.name == null ? "Global Namespace" : node.get_full_name ()).end_tag ("h1");
+ writer.start_tag ("h1", {"class", css_title})
+ .text (node.name == null ? "Global Namespace" : node.get_full_name ())
+ .end_tag ("h1");
writer.simple_tag ("hr", {"class", css_hr});
- writer.start_tag ("h2", {"class", css_title}).text ("Description:").end_tag ("h2");
+ writer.start_tag ("h2", {"class", css_title})
+ .text ("Description:")
+ .end_tag ("h2");
this.write_documentation (node, parent);
- writer.start_tag ("h2", {"class", css_title}).text ("Content:").end_tag ("h2");
+ writer.start_tag ("h2", {"class", css_title})
+ .text ("Content:")
+ .end_tag ("h2");
if (node.name == null) {
this.write_child_namespaces ((Package) node.parent, parent);
protected void write_package_content (Package node, Api.Node? parent) {
writer.start_tag ("div", {"class", css_style_content});
- writer.start_tag ("h1", {"class", css_title, "id", node.name}).text (node.name).end_tag ("h1");
+ writer.start_tag ("h1", {"class", css_title, "id", node.name})
+ .text (node.name)
+ .end_tag ("h1");
writer.simple_tag ("hr", {"class", css_headline_hr});
- writer.start_tag ("h2", {"class", css_title}).text ("Description:").end_tag ("h2");
+ writer.start_tag ("h2", {"class", css_title})
+ .text ("Description:")
+ .end_tag ("h2");
WikiPage? wikipage = (tree.wikitree == null)? null : tree.wikitree.search ("index.valadoc");
_renderer.render (wikipage.documentation);
}
- writer.start_tag ("h2", {"class", css_title}).text ("Content:").end_tag ("h2");
+ writer.start_tag ("h2", {"class", css_title})
+ .text ("Content:")
+ .end_tag ("h2");
this.write_child_namespaces (node, parent);
writer.start_tag ("html");
writer.start_tag ("head");
if (title == null) {
- writer.start_tag ("title").text ("Vala Binding Reference").end_tag ("title");
+ writer.start_tag ("title")
+ .text ("Vala Binding Reference")
+ .end_tag ("title");
} else {
- writer.start_tag ("title").text (title).text (" – Vala Binding Reference").end_tag ("title");
+ writer.start_tag ("title")
+ .text (title)
+ .text (" – Vala Binding Reference")
+ .end_tag ("title");
}
writer.stylesheet_link (css);
writer.javascript_link (js);
// avoid broken implicit copy
unowned FileStream _stream = stream;
- base ((str) => { _stream.printf (str); }, xml_declaration);
+ base ((str) => {
+ _stream.printf (str);
+ }, xml_declaration);
}
public MarkupWriter.builder (StringBuilder builder, bool xml_declaration = true) {
// avoid broken implicit copy
unowned StringBuilder _builder = builder;
- base ((str) => { _builder.append (str); }, xml_declaration);
+ base ((str) => {
+ _builder.append (str);
+ }, xml_declaration);
}
public MarkupWriter add_usemap (Charts.Chart chart) {
private void write_resolved_symbol_link (Api.Node symbol, string? given_label) {
if (symbol == _container || symbol == _owner) {
- writer.start_tag ("span", {"css", cssresolver.resolve (symbol)}).text (symbol.name).end_tag ("span");
+ writer.start_tag ("span", {"css", cssresolver.resolve (symbol)})
+ .text (symbol.name)
+ .end_tag ("span");
} else {
var label = (given_label == null || given_label == "") ? symbol.get_full_name () : given_label;
var url = get_url (symbol);
write_taglets (
() => {
writer.start_tag ("p", {"class", "main_title"});
- writer.start_tag ("b").text ("Deprecated: ").end_tag ("b");
+ writer.start_tag ("b")
+ .text ("Deprecated: ")
+ .end_tag ("b");
},
() => {
writer.end_tag ("p");
write_taglets (
() => {
- writer.start_tag ("h2", {"class", "main_title"}).text ("Parameters:").end_tag ("h2");
+ writer.start_tag ("h2", {"class", "main_title"})
+ .text ("Parameters:")
+ .end_tag ("h2");
writer.start_tag ("table", {"class", "main_parameter_table"});
},
() => {
}
writer.start_tag ("tr", unknown_parameter_css);
- writer.start_tag ("td", {"class", "main_parameter_table_name"}).text (param.parameter_name).end_tag ("td");
+ writer.start_tag ("td", {"class", "main_parameter_table_name"})
+ .text (param.parameter_name)
+ .end_tag ("td");
writer.start_tag ("td");
param.accept_children (this);
writer.end_tag ("td");
taglets = element.find_taglets ((Api.Node) _container, typeof (Taglets.Return));
write_taglets (
() => {
- writer.start_tag ("h2", {"class", "main_title"}).text ("Returns:").end_tag ("h2");
+ writer.start_tag ("h2", {"class", "main_title"})
+ .text ("Returns:")
+ .end_tag ("h2");
writer.start_tag ("table", {"class", "main_parameter_table"});
},
() => {
taglets = element.find_taglets ((Api.Node) _container, typeof (Taglets.Throws));
write_taglets (
() => {
- writer.start_tag ("h2", {"class", "main_title"}).text ("Exceptions:").end_tag ("h2");
+ writer.start_tag ("h2", {"class", "main_title"})
+ .text ("Exceptions:")
+ .end_tag ("h2");
writer.start_tag ("table", {"class", "main_parameter_table"});
},
() => {
(taglet) => {
var exception = taglet as Taglets.Throws;
writer.start_tag ("tr");
- writer.start_tag ("td", {"class", "main_parameter_table_name"}).text (exception.error_domain_name).end_tag ("td");
+ writer.start_tag ("td", {"class", "main_parameter_table_name"})
+ .text (exception.error_domain_name)
+ .end_tag ("td");
writer.start_tag ("td");
exception.accept_children (this);
writer.end_tag ("td");
taglets = element.find_taglets ((Api.Node) _container, typeof (Taglets.Since));
write_taglets (
() => {
- writer.start_tag ("h2", {"class", "main_title"}).text ("Since:").end_tag ("h2");
+ writer.start_tag ("h2", {"class", "main_title"})
+ .text ("Since:")
+ .end_tag ("h2");
writer.start_tag ("p");
},
() => {
taglets = element.find_taglets ((Api.Node) _container, typeof (Taglets.See));
write_taglets (
() => {
- writer.start_tag ("h2", {"class", "main_title"}).text ("See also:").end_tag ("h2");
+ writer.start_tag ("h2", {"class", "main_title"})
+ .text ("See also:")
+ .end_tag ("h2");
writer.start_tag ("p");
},
() => {
public override void visit_embedded (Embedded element) {
var caption = element.caption;
- var absolute_path = Path.build_filename (settings.path, element.package.name, "img", Path.get_basename (element.url));
+ var absolute_path = Path.build_filename (settings.path, element.package.name, "img",
+ Path.get_basename (element.url));
var relative_path = Path.build_filename ("img", Path.get_basename (element.url));
copy_file (element.url, absolute_path);
private void visit_notification_block (BlockContent element, string headline) {
writer.start_tag ("div", {"class", "main_notification_block"});
- writer.start_tag ("span", {"class", "main_block_headline"}).text (headline).end_tag ("span").text (" ");
+ writer.start_tag ("span", {"class", "main_block_headline"})
+ .text (headline)
+ .end_tag ("span")
+ .text (" ");
writer.start_tag ("div", {"class", "main_block_content"});
element.accept_children (this);
writer.end_tag ("div");
public class Valadoc.Importer.GirDocumentationImporter : DocumentationImporter {
- public override string file_extension { get { return "gir"; } }
+ public override string file_extension {
+ get {
+ return "gir";
+ }
+ }
private MarkupTokenType current_token;
private MarkupSourceLocation begin;
}
}
- public GirDocumentationImporter (Api.Tree tree, DocumentationParser parser, ModuleLoader modules, Settings settings, ErrorReporter reporter) {
+ public GirDocumentationImporter (Api.Tree tree, DocumentationParser parser,
+ ModuleLoader modules, Settings settings,
+ ErrorReporter reporter)
+ {
base (tree, modules, settings);
this.reporter = reporter;
this.parser = parser;
}
public override void process (string source_file) {
- this.file = new Api.SourceFile (new Api.Package (Path.get_basename (source_file), true, null), source_file, null, null);
+ this.file = new Api.SourceFile (new Api.Package (Path.get_basename (source_file), true, null),
+ source_file, null, null);
this.reader = new MarkupReader (source_file, reporter);
// xml prolog
return param_names[length_pos];
}
- private void attach_comment (string cname, Api.GirSourceComment? comment, string[]? param_names = null, ImplicitParameterPos[]? destroy_notifies = null, ImplicitParameterPos[]? closures = null, ImplicitParameterPos[]? array_lengths = null, int array_length_ret = -1) {
+ private void attach_comment (string cname,
+ Api.GirSourceComment? comment,
+ string[]? param_names = null,
+ ImplicitParameterPos[]? destroy_notifies = null,
+ ImplicitParameterPos[]? closures = null,
+ ImplicitParameterPos[]? array_lengths = null,
+ int array_length_ret = -1)
+ {
if (comment == null) {
return ;
}
continue ;
}
- param.implicit_destroy_cparameter_name = get_cparameter_name (param_names, pos.position);
+ param.implicit_destroy_cparameter_name
+ = get_cparameter_name (param_names, pos.position);
}
foreach (ImplicitParameterPos pos in closures) {
continue ;
}
- param.implicit_closure_cparameter_name = get_cparameter_name (param_names, pos.position);
+ param.implicit_closure_cparameter_name
+ = get_cparameter_name (param_names, pos.position);
}
foreach (ImplicitParameterPos pos in array_lengths) {
continue ;
}
- param.implicit_array_length_cparameter_name = get_cparameter_name (param_names, pos.position);
+ param.implicit_array_length_cparameter_name
+ = get_cparameter_name (param_names, pos.position);
}
if (node is Api.Callable) {
- ((Api.Callable) node).implicit_array_length_cparameter_name = get_cparameter_name (param_names, array_length_ret);
+ ((Api.Callable) node).implicit_array_length_cparameter_name
+ = get_cparameter_name (param_names, array_length_ret);
}
}
}
private void warning (string message) {
- reporter.warning (this.file.relative_path, this.begin.line, this.begin.column, this.end.column, this.reader.get_line_content (this.begin.line), message);
+ reporter.warning (this.file.relative_path, this.begin.line, this.begin.column, this.end.column,
+ this.reader.get_line_content (this.begin.line), message);
}
private void error (string message) {
- reporter.error (this.file.relative_path, this.begin.line, this.begin.column, this.end.column, this.reader.get_line_content (this.begin.line), message);
+ reporter.error (this.file.relative_path, this.begin.line, this.begin.column, this.end.column,
+ this.reader.get_line_content (this.begin.line), message);
}
private void next () {
private void parse_repository () {
start_element ("repository");
if (reader.get_attribute ("version") != GIR_VERSION) {
- error ("unsupported GIR version %s (supported: %s)".printf (reader.get_attribute ("version"), GIR_VERSION));
+ error ("unsupported GIR version %s (supported: %s)"
+ .printf (reader.get_attribute ("version"), GIR_VERSION));
return;
}
next ();
Api.GirSourceComment? comment = null;
if (current_token == MarkupTokenType.TEXT) {
- comment = new Api.GirSourceComment (reader.content, file, begin.line, begin.column, end.line, end.column);
+ comment = new Api.GirSourceComment (reader.content, file, begin.line,
+ begin.column, end.line, end.column);
next ();
}
Api.SourceComment? comment = null;
if (current_token == MarkupTokenType.TEXT) {
- comment = new Api.SourceComment (reader.content, file, begin.line, begin.column, end.line, end.column);
+ comment = new Api.SourceComment (reader.content, file, begin.line,
+ begin.column, end.line, end.column);
next ();
}
end_element ("return-value");
}
- private void parse_parameter (out Api.SourceComment? comment, out string param_name, out int destroy_pos, out int closure_pos, out int array_length_pos) {
+ private void parse_parameter (out Api.SourceComment? comment, out string param_name,
+ out int destroy_pos,
+ out int closure_pos, out int array_length_pos) {
start_element ("parameter");
param_name = reader.get_attribute ("name");
array_length_pos = -1;
private void parse_property () {
start_element ("property");
- string c_identifier = "%s:%s".printf (parent_c_identifier, reader.get_attribute ("name").replace ("-", "_"));
+ string c_identifier = "%s:%s".printf (parent_c_identifier, reader.get_attribute ("name")
+ .replace ("-", "_"));
next ();
Api.GirSourceComment? comment = parse_symbol_doc ();
break;
case "virtual-method":
- c_identifier = "%s->%s".printf (this.parent_c_identifier, reader.get_attribute ("name").replace ("-", "_"));
+ c_identifier = "%s->%s".printf (this.parent_c_identifier, reader.get_attribute ("name")
+ .replace ("-", "_"));
break;
case "glib:signal":
- c_identifier = "%s::%s".printf (this.parent_c_identifier, reader.get_attribute ("name").replace ("-", "_"));
+ c_identifier = "%s::%s".printf (this.parent_c_identifier, reader.get_attribute ("name")
+ .replace ("-", "_"));
break;
default:
parse_return_value (out return_comment, out array_length_ret);
if (return_comment != null) {
if (comment == null) {
- comment = new Api.GirSourceComment ("", file, begin.line, begin.column, end.line, end.column);
+ comment = new Api.GirSourceComment ("", file, begin.line, begin.column,
+ end.line, end.column);
}
comment.return_comment = return_comment;
}
int closure_pos;
string? param_name;
- parse_parameter (out param_comment, out param_name, out destroy_pos, out closure_pos, out array_length_pos);
+ parse_parameter (out param_comment, out param_name, out destroy_pos,
+ out closure_pos, out array_length_pos);
param_names += param_name;
if (destroy_pos >= 0 && pcount != destroy_pos) {
if (param_comment != null) {
if (comment == null) {
- comment = new Api.GirSourceComment ("", file, begin.line, begin.column, end.line, end.column);
+ comment = new Api.GirSourceComment ("", file, begin.line, begin.column,
+ end.line, end.column);
}
comment.add_parameter_content (param_name, param_comment);
end_element ("parameters");
}
- attach_comment (c_identifier, comment, param_names, destroy_notifies, closures, array_lengths, array_length_ret);
+ attach_comment (c_identifier, comment, param_names, destroy_notifies, closures,
+ array_lengths, array_length_ret);
end_element (element_name);
}
private ErrorReporter reporter;
- public ValadocDocumentationImporter (Api.Tree tree, DocumentationParser parser, ModuleLoader modules, Settings settings, ErrorReporter reporter) {
+ public ValadocDocumentationImporter (Api.Tree tree, DocumentationParser parser, ModuleLoader modules,
+ Settings settings, ErrorReporter reporter)
+ {
base (tree, modules, settings);
this.factory = new Content.ContentFactory (settings, this, modules);
this.reporter = reporter;
REPLACE
}
- private void add_documentation (string _symbol_name, StringBuilder? comment, string filename, SourceLocation src_ref) {
+ private void add_documentation (string _symbol_name, StringBuilder? comment, string filename,
+ SourceLocation src_ref)
+ {
Api.Node? symbol = null;
InsertionMode insertion_mode;
return false;
}
- public override bool accept_token (Token token, ParserCallback parser, Rule.Forward forward) throws ParserError {
+ public override bool accept_token (Token token, ParserCallback parser, Rule.Forward forward)
+ throws ParserError
+ {
var state = parser.get_rule_state () as State;
if (state == null) {
state = new State ();
if (state == null) {
state = new State ();
}
- return "%-15s%-15s(started=%s;done_one=%s)".printf (name != null ? name : " ", "[many]", state.started.to_string (), state.done_one.to_string ());
+ return "%-15s%-15s(started=%s;done_one=%s)".printf (name != null ? name : " ",
+ "[many]",
+ state.started.to_string (),
+ state.done_one.to_string ());
}
}
return false;
}
- public override bool accept_token (Token token, ParserCallback parser, Rule.Forward forward) throws ParserError {
+ public override bool accept_token (Token token, ParserCallback parser, Rule.Forward forward)
+ throws ParserError
+ {
var state = parser.get_rule_state () as State;
if (state == null) {
state = new State ();
if (state == null) {
state = new State ();
}
- return "%-15s%-15s(selected=%d/%d)".printf (name != null ? name : " ", "[one-of]", state.selected, _scheme.length);
+ return "%-15s%-15s(selected=%d/%d)".printf (name != null ? name : " ",
+ "[one-of]",
+ state.selected,
+ _scheme.length);
}
}
return has_start_token (_scheme, token);
}
- public override bool accept_token (Token token, ParserCallback parser, Rule.Forward forward) throws ParserError {
+ public override bool accept_token (Token token, ParserCallback parser, Rule.Forward forward)
+ throws ParserError
+ {
var state = parser.get_rule_state () as State;
if (state == null) {
state = new State ();
if (state == null) {
state = new State ();
}
- return "%-15s%-15s(started=%s)".printf (name != null ? name : " ", "[option]", state.started.to_string ());
+ return "%-15s%-15s(started=%s)".printf (name != null ? name : " ",
+ "[option]",
+ state.started.to_string ());
}
}
_root_rule = root_rule;
}
- public void parse (string content, string filename, int first_line, int first_column) throws ParserError {
+ public void parse (string content, string filename, int first_line, int first_column)
+ throws ParserError
+ {
_filename = filename;
_first_line = first_line;
_first_column = first_column;
#if HARD_DEBUG
Rule? parent_rule = peek_rule ();
if (parent_rule != null) {
- debug ("Reduced to %2d: %s", rule_stack.size - 1, parent_rule.to_string (peek_state ()));
+ debug ("Reduced to %2d: %s", rule_stack.size - 1,
+ parent_rule.to_string (peek_state ()));
}
#endif
}
Object? state = peek_state (offset);
while (parent_rule != null) {
#if VERY_HARD_DEBUG
- debug ("WouldAccept - Offset %d; Index %d: %s", offset, rule_stack.size + offset, parent_rule.to_string (state));
+ debug ("WouldAccept - Offset %d; Index %d: %s", offset,
+ rule_stack.size + offset, parent_rule.to_string (state));
#endif
if (parent_rule.would_accept_token (token, state)) {
#if VERY_HARD_DEBUG
Object? state = peek_state (offset);
while (parent_rule != null) {
#if VERY_HARD_DEBUG
- debug ("WouldReduce - Offset %d; Index %d: %s", offset, rule_stack.size + offset, parent_rule.to_string (state));
+ debug ("WouldReduce - Offset %d; Index %d: %s", offset,
+ rule_stack.size + offset, parent_rule.to_string (state));
#endif
if (!parent_rule.would_reduce (token, state)) {
break;
return false;
}
- protected bool try_to_apply (Object? scheme_element, Token token, ParserCallback parser, out bool handled) throws ParserError {
+ protected bool try_to_apply (Object? scheme_element, Token token, ParserCallback parser,
+ out bool handled) throws ParserError
+ {
#if VERY_HARD_DEBUG
{
TokenType? scheme_token = scheme_element as TokenType;
Rule? scheme_rule = scheme_element as Rule;
if (scheme_token != null) {
- message ("TryToApply: token='%s'; scheme_token='%s'", token.to_string (), scheme_token.to_string ());
+ message ("TryToApply: token='%s'; scheme_token='%s'", token.to_string (),
+ scheme_token.to_string ());
} else if (scheme_rule != null) {
- message ("TryToApply: token='%s'; scheme_rule='%s'", token.to_string (), scheme_rule.to_string (parser.get_rule_state ()));
+ message ("TryToApply: token='%s'; scheme_rule='%s'", token.to_string (),
+ scheme_rule.to_string (parser.get_rule_state ()));
} else {
assert (scheme_element != null);
}
return true;
}
- public override bool accept_token (Token token, ParserCallback parser, Rule.Forward forward) throws ParserError {
+ public override bool accept_token (Token token, ParserCallback parser,
+ Rule.Forward forward) throws ParserError
+ {
var state = parser.get_rule_state () as State;
if (state == null) {
state = new State ();
return _rule.starts_with_token (token);
}
- public override bool accept_token (Token token, ParserCallback parser, Rule.Forward forward) throws ParserError {
+ public override bool accept_token (Token token, ParserCallback parser, Rule.Forward forward)
+ throws ParserError
+ {
return _rule.accept_token (token, parser, forward);
}
return run_rule;
}
- public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings 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);
- reporter.simple_warning ("%s: %s: @deprecated: warning: @deprecated is deprecated. Use [Deprecated]", file_path, container.get_full_name ());
+ reporter.simple_warning ("%s: %s: @deprecated: warning: @deprecated is deprecated. Use [Deprecated]",
+ file_path, container.get_full_name ());
}
public override void accept (ContentVisitor visitor) {
return null;
}
- public override void check (Api.Tree api_root, Api.Node container, string file_path, 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
return null;
}
- internal void transform (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) {
+ internal void transform (Api.Tree api_root, Api.Node container, string file_path,
+ ErrorReporter reporter, Settings settings)
+ {
ContentElement separator = this;
Run right_run = null;
Run left_run = null;
}
if (separator is Paragraph == false || separator.parent is Comment == false) {
- reporter.simple_error ("%s: %s: @inheritDoc: error: Parent documentation can't be copied to this location.", file_path, container.get_full_name ());
+ reporter.simple_error ("%s: %s: @inheritDoc: error: Parent documentation can't be copied to this location.",
+ file_path, container.get_full_name ());
return ;
}
});
}
- public override void check (Api.Tree api_root, Api.Node container, string file_path, 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);
if (_symbol == null && symbol_name != "main") {
string node_segment = (container is Api.Package)? "" : container.get_full_name () + ": ";
- reporter.simple_warning ("%s: %s@link: warning: %s does not exist", file_path, node_segment, symbol_name);
+ reporter.simple_warning ("%s: %s@link: warning: %s does not exist",
+ file_path, node_segment, symbol_name);
}
base.check (api_root, container, file_path, reporter, settings);
});
}
- public override void check (Api.Tree api_root, Api.Node container, string file_path, 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
unowned string? implicit_return_array_length = null;
bool is_implicit = false;
if (container is Api.Callable) {
implicit_return_array_length = ((Api.Callable) container).implicit_array_length_cparameter_name;
} else {
- reporter.simple_warning ("%s: %s: @param: warning: @param used outside method/delegate/signal context", file_path, container.get_full_name ());
+ reporter.simple_warning ("%s: %s: @param: warning: @param used outside method/delegate/signal context",
+ file_path, container.get_full_name ());
base.check (api_root, container, file_path, reporter, settings);
return ;
}
}
}
} else {
- Gee.List<Api.Node> params = container.get_children_by_types ({Api.NodeType.FORMAL_PARAMETER, Api.NodeType.TYPE_PARAMETER}, false);
+ Gee.List<Api.Node> params = container.get_children_by_types ({Api.NodeType.FORMAL_PARAMETER,
+ Api.NodeType.TYPE_PARAMETER},
+ false);
int pos = 0;
foreach (Api.Node param in params) {
}
Api.FormalParameter formalparam = param as Api.FormalParameter;
- if (formalparam != null && (formalparam.implicit_array_length_cparameter_name == parameter_name || formalparam.implicit_closure_cparameter_name == parameter_name || formalparam.implicit_destroy_cparameter_name == parameter_name)) {
+ if (formalparam != null && (formalparam.implicit_array_length_cparameter_name == parameter_name
+ || formalparam.implicit_closure_cparameter_name == parameter_name
+ || formalparam.implicit_destroy_cparameter_name == parameter_name))
+ {
is_implicit = true;
break;
}
pos++;
}
- if (this.parameter == null && (parameter_name == "error" && container.has_children ({Api.NodeType.ERROR_DOMAIN, Api.NodeType.CLASS})
- || parameter_name == implicit_return_array_length)) {
+ if (this.parameter == null
+ && (parameter_name == "error"
+ && container.has_children ({Api.NodeType.ERROR_DOMAIN, Api.NodeType.CLASS})
+ || parameter_name == implicit_return_array_length))
+ {
is_implicit = true;
}
}
if (this.parameter == null) {
if (is_implicit) {
- reporter.simple_note ("%s: %s: @param: warning: Implicit parameter `%s' exposed in documentation", file_path, container.get_full_name (), parameter_name);
+ reporter.simple_note ("%s: %s: @param: warning: Implicit parameter `%s' exposed in documentation",
+ file_path, container.get_full_name (), parameter_name);
} else {
- reporter.simple_warning ("%s: %s: @param: warning: Unknown parameter `%s'", file_path, container.get_full_name (), parameter_name);
+ reporter.simple_warning ("%s: %s: @param: warning: Unknown parameter `%s'",
+ file_path, container.get_full_name (), parameter_name);
}
}
return run_rule;
}
- public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) {
+ public override void check (Api.Tree api_root, Api.Node container, string file_path,
+ ErrorReporter reporter, Settings settings) {
Api.TypeReference? type_ref = null;
bool creation_method = false;
} else if (container is Api.Callable) {
type_ref = ((Api.Callable) container).return_type;
} else {
- reporter.simple_warning ("%s: %s: @return: warning: @return used outside method/delegate/signal context", file_path, container.get_full_name ());
+ reporter.simple_warning ("%s: %s: @return: warning: @return used outside method/delegate/signal context",
+ file_path, container.get_full_name ());
}
if (type_ref != null && type_ref.data_type == null && !creation_method) {
- reporter.simple_warning ("%s: %s: @return: warning: Return description declared for void function", file_path, container.get_full_name ());
+ reporter.simple_warning ("%s: %s: @return: warning: Return description declared for void function",
+ file_path, container.get_full_name ());
}
base.check (api_root, container, file_path, reporter, settings);
});
}
- public override void check (Api.Tree api_root, Api.Node container, string file_path, 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);
if (symbol == null) {
// TODO use ContentElement's source reference
- reporter.simple_warning ("%s: %s: @see: warning: %s does not exist", file_path, container.get_full_name (), symbol_name);
+ reporter.simple_warning ("%s: %s: @see: warning: %s does not exist",
+ file_path, container.get_full_name (), symbol_name);
}
}
});
}
- public override void check (Api.Tree api_root, Api.Node container, string file_path, 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) {
});
}
- public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) {
+ public override void check (Api.Tree api_root, Api.Node container, string file_path,
+ ErrorReporter reporter, Settings settings)
+ {
// context check:
if (container is Api.Method == false && container is Api.Delegate == false) {
- reporter.simple_warning ("%s: %s: @throws: warning: @throws used outside method/delegate context", file_path, container.get_full_name ());
+ reporter.simple_warning ("%s: %s: @throws: warning: @throws used outside method/delegate context",
+ file_path, container.get_full_name ());
base.check (api_root, container, file_path, reporter, settings);
return ;
}
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: %s: @throws: error: %s does not exist", file_path, container.get_full_name (), error_domain_name);
+ reporter.simple_error ("%s: %s: @throws: error: %s does not exist",
+ file_path, container.get_full_name (), error_domain_name);
base.check (api_root, container, file_path, reporter, settings);
return ;
}
// Check if the method is allowed to throw the given type or error code:
- Gee.List<Api.Node> exceptions = container.get_children_by_types ({Api.NodeType.ERROR_DOMAIN, Api.NodeType.CLASS}, false);
- Api.Item expected_error_domain = (error_domain is Api.ErrorCode)? error_domain.parent : error_domain;
+ Gee.List<Api.Node> exceptions = container.get_children_by_types ({Api.NodeType.ERROR_DOMAIN,
+ Api.NodeType.CLASS},
+ false);
+ Api.Item expected_error_domain = (error_domain is Api.ErrorCode)
+ ? error_domain.parent
+ : error_domain;
bool report_warning = true;
foreach (Api.Node exception in exceptions) {
- if (exception == expected_error_domain || (exception is Api.Class && expected_error_domain is Api.ErrorDomain)) {
+ if (exception == expected_error_domain
+ || (exception is Api.Class && expected_error_domain is Api.ErrorDomain))
+ {
report_warning = false;
break;
}
}
if (report_warning) {
- reporter.simple_warning ("%s: %s: @throws: warning: %s does not exist in exception list", file_path, container.get_full_name (), error_domain_name);
+ reporter.simple_warning ("%s: %s: @throws: warning: %s does not exist in exception list",
+ file_path, container.get_full_name (), error_domain_name);
}
base.check (api_root, container, file_path, reporter, settings);