From: Rico Tzschichholz Date: Sun, 16 Sep 2018 14:38:11 +0000 (+0200) Subject: libvaladoc: Drop MethodBindingType X-Git-Tag: 0.43.1~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77c480431bc87350b592a5c1c836be6e9bb9e63c;p=thirdparty%2Fvala.git libvaladoc: Drop MethodBindingType --- diff --git a/libvaladoc/Makefile.am b/libvaladoc/Makefile.am index 640e98c80..29386d473 100644 --- a/libvaladoc/Makefile.am +++ b/libvaladoc/Makefile.am @@ -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 \ diff --git a/libvaladoc/api/method.vala b/libvaladoc/api/method.vala index a1aaa4870..11d2372b5 100644 --- a/libvaladoc/api/method.vala +++ b/libvaladoc/api/method.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; } } diff --git a/libvaladoc/api/methodbindingtype.vala b/libvaladoc/api/methodbindingtype.vala deleted file mode 100644 index 0e1df797e..000000000 --- a/libvaladoc/api/methodbindingtype.vala +++ /dev/null @@ -1,55 +0,0 @@ -/* 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 - */ - - -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 (); - } -} diff --git a/valadoc/treebuilder.vala b/valadoc/treebuilder.vala index 5c26ab920..40cffb474 100644 --- a/valadoc/treebuilder.vala +++ b/valadoc/treebuilder.vala @@ -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,