Commit 77c48043 authored by Rico Tzschichholz's avatar Rico Tzschichholz

libvaladoc: Drop MethodBindingType

parent 96ccd5bd
......@@ -72,7 +72,6 @@ libvaladoc_la_VALASOURCES = \
api/interface.vala \
api/item.vala \
api/method.vala \
api/methodbindingtype.vala \
api/namespace.vala \
api/node.vala \
api/nodetype.vala \
......
......@@ -32,8 +32,6 @@ public class Valadoc.Api.Method : Symbol, Callable {
private string? dbus_name;
private string? cname;
private MethodBindingType binding_type;
/**
* {@inheritDoc}
*/
......@@ -45,7 +43,7 @@ public class Valadoc.Api.Method : Symbol, Callable {
public Method (Node parent, SourceFile file, string name, Vala.SymbolAccessibility accessibility,
SourceComment? comment, string? cname, string? dbus_name, string? dbus_result_name,
string? finish_function_cname, MethodBindingType binding_type, bool is_yields,
string? finish_function_cname, bool is_yields,
bool is_dbus_visible, bool is_constructor, Vala.Method data)
{
base (parent, file, name, accessibility, comment, data);
......@@ -55,7 +53,6 @@ public class Valadoc.Api.Method : Symbol, Callable {
this.dbus_name = dbus_name;
this.cname = cname;
this.binding_type = binding_type;
this.is_dbus_visible = is_dbus_visible;
this.is_constructor = is_constructor;
this.is_yields = is_yields;
......@@ -115,7 +112,7 @@ public class Valadoc.Api.Method : Symbol, Callable {
*/
public bool is_abstract {
get {
return binding_type == MethodBindingType.ABSTRACT;
return ((Vala.Method) data).is_abstract;
}
}
......@@ -124,7 +121,7 @@ public class Valadoc.Api.Method : Symbol, Callable {
*/
public bool is_virtual {
get {
return binding_type == MethodBindingType.VIRTUAL;
return ((Vala.Method) data).is_virtual;
}
}
......@@ -133,7 +130,7 @@ public class Valadoc.Api.Method : Symbol, Callable {
*/
public bool is_override {
get {
return binding_type == MethodBindingType.OVERRIDE;
return ((Vala.Method) data).overrides;
}
}
......@@ -142,7 +139,7 @@ public class Valadoc.Api.Method : Symbol, Callable {
*/
public bool is_static {
get {
return !is_constructor && binding_type == MethodBindingType.STATIC
return !is_constructor && ((Vala.Method) data).binding == Vala.MemberBinding.STATIC
&& parent is Namespace == false;
}
}
......@@ -160,7 +157,7 @@ public class Valadoc.Api.Method : Symbol, Callable {
*/
public bool is_inline {
get {
return binding_type == MethodBindingType.INLINE;
return ((Vala.Method) data).is_inline;
}
}
......
/* methodbindingtype.vala
*
* 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:
* Brosch Florian <flo.brosch@gmail.com>
*/
public enum Valadoc.MethodBindingType {
UNMODIFIED,
OVERRIDE,
ABSTRACT,
VIRTUAL,
INLINE,
STATIC;
public unowned string to_string () {
switch (this) {
case OVERRIDE:
return "override";
case ABSTRACT:
return "abstract";
case VIRTUAL:
return "virtual";
case INLINE:
return "inline";
case STATIC:
return "static";
case UNMODIFIED:
return "";
}
assert_not_reached ();
}
}
......@@ -558,23 +558,6 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
return meta_data.get_namespace ((Vala.Namespace) namespace_symbol, file);
}
private MethodBindingType get_method_binding_type (Vala.Method element) {
if (element.is_inline) {
return MethodBindingType.INLINE;
} else if (element.is_abstract) {
return MethodBindingType.ABSTRACT;
} else if (element.is_virtual) {
return MethodBindingType.VIRTUAL;
} else if (element.overrides) {
return MethodBindingType.OVERRIDE;
} else if (element.is_inline) {
return MethodBindingType.INLINE;
} else if (element.binding != Vala.MemberBinding.INSTANCE) {
return MethodBindingType.STATIC;
}
return MethodBindingType.UNMODIFIED;
}
private PropertyAccessorType get_property_accessor_type (Vala.PropertyAccessor element) {
if (element.construction) {
if (element.writable) {
......@@ -1180,7 +1163,6 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
Vala.GDBusModule.get_dbus_name_for_member (element),
Vala.GDBusModule.dbus_result_name (element),
(element.coroutine)? get_finish_name (element) : null,
get_method_binding_type (element),
element.coroutine,
Vala.GDBusModule.is_dbus_visible (element),
element is Vala.CreationMethod,
......@@ -1210,7 +1192,6 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
Vala.GDBusModule.get_dbus_name_for_member (element),
Vala.GDBusModule.dbus_result_name (element),
(element.coroutine)? get_finish_name (element) : null,
get_method_binding_type (element),
element.coroutine,
Vala.GDBusModule.is_dbus_visible (element),
element is Vala.CreationMethod,
......
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