Commit 96ccd5bd authored by Rico Tzschichholz's avatar Rico Tzschichholz

libvaladoc: Drop Api.Member

parent 362eec6b
......@@ -71,7 +71,6 @@ libvaladoc_la_VALASOURCES = \
api/formalparameter.vala \
api/interface.vala \
api/item.vala \
api/member.vala \
api/method.vala \
api/methodbindingtype.vala \
api/namespace.vala \
......
......@@ -26,7 +26,7 @@ using Valadoc.Content;
/**
* Represents a type member with a constant value.
*/
public class Valadoc.Api.Constant : Member {
public class Valadoc.Api.Constant : Symbol {
private string? cname;
/**
......
......@@ -27,7 +27,6 @@ using Valadoc.Content;
* Represents an enum member.
*/
public class Valadoc.Api.EnumValue: Symbol {
private SourceComment? source_comment;
private string? cname;
public Content.Run default_value {
......@@ -45,38 +44,11 @@ public class Valadoc.Api.EnumValue: Symbol {
}
public EnumValue (Enum parent, SourceFile file, string name, SourceComment? comment, string? cname, Vala.EnumValue data) {
base (parent, file, name, parent.accessibility, data);
base (parent, file, name, parent.accessibility, comment, data);
this.source_comment = comment;
this.cname = cname;
}
/**
* {@inheritDoc}
*/
internal override void parse_comments (Settings settings, DocumentationParser parser) {
if (documentation != null) {
return ;
}
if (source_comment != null) {
documentation = parser.parse (this, source_comment);
}
base.parse_comments (settings, parser);
}
/**
* {@inheritDoc}
*/
internal override void check_comments (Settings settings, DocumentationParser parser) {
if (documentation != null) {
parser.check (this, documentation);
}
base.check_comments (settings, parser);
}
/**
* Returns the name of this enum value as it is used in C.
*/
......
......@@ -27,46 +27,18 @@ using Valadoc.Content;
* Represents an errordomain member in the source code.
*/
public class Valadoc.Api.ErrorCode : Symbol {
private SourceComment? source_comment;
private string? dbus_name;
private string? cname;
public ErrorCode (ErrorDomain parent, SourceFile file, string name, SourceComment? comment,
string? cname, string? dbus_name, Vala.ErrorCode data)
{
base (parent, file, name, parent.accessibility, data);
base (parent, file, name, parent.accessibility, comment, data);
this.source_comment = comment;
this.dbus_name = dbus_name;
this.cname = cname;
}
/**
* {@inheritDoc}
*/
internal override void parse_comments (Settings settings, DocumentationParser parser) {
if (documentation != null) {
return ;
}
if (source_comment != null) {
documentation = parser.parse (this, source_comment);
}
base.parse_comments (settings, parser);
}
/**
* {@inheritDoc}
*/
internal override void check_comments (Settings settings, DocumentationParser parser) {
if (documentation != null) {
parser.check (this, documentation);
}
base.check_comments (settings, parser);
}
/**
* Returns the name of this class as it is used in C.
*/
......
......@@ -26,7 +26,7 @@ using Valadoc.Content;
/**
* Represents a field.
*/
public class Valadoc.Api.Field : Member {
public class Valadoc.Api.Field : Symbol {
private string? cname;
public Field (Node parent, SourceFile file, string name, Vala.SymbolAccessibility accessibility,
......
......@@ -59,7 +59,7 @@ public class Valadoc.Api.FormalParameter : Symbol {
private Vala.ParameterDirection type;
public FormalParameter (Node parent, SourceFile file, string? name, Vala.SymbolAccessibility accessibility, Vala.ParameterDirection type, bool ellipsis, Vala.Parameter data) {
base (parent, file, name, accessibility, data);
base (parent, file, name, accessibility, null, data);
assert ((name == null && ellipsis) || (name != null && !ellipsis));
this.ellipsis = ellipsis;
......
/* member.vala
*
* Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois
* Copyright (C) 2011 Florian Brosch
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Author:
* Didier 'Ptitjes Villevalois <ptitjes@free.fr>
*/
public abstract class Valadoc.Api.Member : Symbol {
private SourceComment? source_comment;
public Member (Node parent, SourceFile file, string name, Vala.SymbolAccessibility accessibility,
SourceComment? comment, Vala.Symbol data)
{
base (parent, file, name, accessibility, data);
this.source_comment = comment;
}
/**
* {@inheritDoc}
*/
internal override void parse_comments (Settings settings, DocumentationParser parser) {
if (documentation != null) {
return ;
}
if (source_comment != null) {
documentation = parser.parse (this, source_comment);
}
base.parse_comments (settings, parser);
}
/**
* {@inheritDoc}
*/
internal override void check_comments (Settings settings, DocumentationParser parser) {
if (documentation != null) {
parser.check (this, documentation);
}
base.check_comments (settings, parser);
}
}
......@@ -26,7 +26,7 @@ using Valadoc.Content;
/**
* Represents a function or a method.
*/
public class Valadoc.Api.Method : Member, Callable {
public class Valadoc.Api.Method : Symbol, Callable {
private string? finish_function_cname;
private string? dbus_result_name;
private string? dbus_name;
......
......@@ -27,42 +27,10 @@ using Valadoc.Content;
* Represents a namespace declaration.
*/
public class Valadoc.Api.Namespace : Symbol {
private SourceComment? source_comment;
public Namespace (Api.Node parent, SourceFile file, string? name, SourceComment? comment, Vala.Namespace data) {
base (parent, file, name, Vala.SymbolAccessibility.PUBLIC, data);
this.source_comment = comment;
base (parent, file, name, Vala.SymbolAccessibility.PUBLIC, comment, data);
}
/**
* {@inheritDoc}
*/
internal override void parse_comments (Settings settings, DocumentationParser parser) {
if (documentation != null) {
return ;
}
if (source_comment != null) {
documentation = parser.parse (this, source_comment);
}
base.parse_comments (settings, parser);
}
/**
* {@inheritDoc}
*/
internal override void check_comments (Settings settings, DocumentationParser parser) {
if (documentation != null) {
parser.check (this, documentation);
}
base.check_comments (settings, parser);
}
/**
* {@inheritDoc}
*/
......
......@@ -26,7 +26,7 @@ using Valadoc.Content;
/**
* Represents a property declaration.
*/
public class Valadoc.Api.Property : Member {
public class Valadoc.Api.Property : Symbol {
private PropertyBindingType binding_type;
private string? dbus_name;
private string? cname;
......
......@@ -34,7 +34,7 @@ public class Valadoc.Api.PropertyAccessor : Symbol {
public PropertyAccessor (Property parent, SourceFile file, string name, Vala.SymbolAccessibility accessibility,
string? cname, PropertyAccessorType type, Ownership ownership, Vala.PropertyAccessor data)
{
base (parent, file, name, accessibility, data);
base (parent, file, name, accessibility, null, data);
this.ownership = ownership;
this.cname = cname;
......
......@@ -26,7 +26,7 @@ using Valadoc.Content;
/**
* Represents an signal.
*/
public class Valadoc.Api.Signal : Member, Callable {
public class Valadoc.Api.Signal : Symbol, Callable {
private string? default_impl_cname;
private string? dbus_name;
private string? cname;
......
......@@ -27,6 +27,7 @@
*/
public abstract class Valadoc.Api.Symbol : Node {
private Vala.ArrayList<Attribute> attributes;
private SourceComment? source_comment;
public bool is_deprecated {
default = false;
......@@ -35,11 +36,12 @@ public abstract class Valadoc.Api.Symbol : Node {
}
public Symbol (Node parent, SourceFile file, string? name, Vala.SymbolAccessibility accessibility,
Vala.Symbol data)
SourceComment? comment, Vala.Symbol data)
{
base (parent, file, name, data);
this.accessibility = accessibility;
this.source_comment = comment;
}
public void add_attribute (Attribute att) {
......@@ -153,5 +155,31 @@ public abstract class Valadoc.Api.Symbol : Node {
return accessibility == Vala.SymbolAccessibility.PRIVATE;
}
}
/**
* {@inheritDoc}
*/
internal override void parse_comments (Settings settings, DocumentationParser parser) {
if (documentation != null) {
return ;
}
if (source_comment != null) {
documentation = parser.parse (this, source_comment);
}
base.parse_comments (settings, parser);
}
/**
* {@inheritDoc}
*/
internal override void check_comments (Settings settings, DocumentationParser parser) {
if (documentation != null) {
parser.check (this, documentation);
}
base.check_comments (settings, parser);
}
}
......@@ -29,7 +29,7 @@ using Valadoc.Content;
public class Valadoc.Api.TypeParameter : Symbol {
public TypeParameter (Node parent, SourceFile file, string name, Vala.TypeParameter data) {
base (parent, file, name, Vala.SymbolAccessibility.PUBLIC, data);
base (parent, file, name, Vala.SymbolAccessibility.PUBLIC, null, data);
}
/**
......
......@@ -26,7 +26,6 @@
* Represents a runtime data type.
*/
public abstract class Valadoc.Api.TypeSymbol : Symbol {
private SourceComment? source_comment;
private string? type_macro_name;
private string? is_type_macro_name;
private string? type_cast_macro_name;
......@@ -37,7 +36,7 @@ public abstract class Valadoc.Api.TypeSymbol : Symbol {
string? type_cast_macro_name, string? type_function_name, bool is_basic_type,
Vala.TypeSymbol data)
{
base (parent, file, name, accessibility, data);
base (parent, file, name, accessibility, comment, data);
this.type_cast_macro_name = type_cast_macro_name;
this.is_type_macro_name = is_type_macro_name;
......@@ -45,7 +44,6 @@ public abstract class Valadoc.Api.TypeSymbol : Symbol {
this.type_macro_name = type_macro_name;
this.is_basic_type = is_basic_type;
this.source_comment = comment;
}
/**
......@@ -83,30 +81,4 @@ public abstract class Valadoc.Api.TypeSymbol : Symbol {
public string get_type_function_name () {
return type_function_name;
}
/**
* {@inheritDoc}
*/
internal override void parse_comments (Settings settings, DocumentationParser parser) {
if (documentation != null) {
return ;
}
if (source_comment != null) {
documentation = parser.parse (this, source_comment);
}
base.parse_comments (settings, parser);
}
/**
* {@inheritDoc}
*/
internal override void check_comments (Settings settings, DocumentationParser parser) {
if (documentation != null) {
parser.check (this, documentation);
}
base.check_comments (settings, parser);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment